        /* === プロフェッショナル地震情報システム CSS === */
        
        /* リセット & 基本設定 */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        /* === テーマ変数 (背景色のみ・前景/アクセント色は維持) === */
        :root {
            /* デフォルト: 既存の青寄りグラデ */
            --bg-page: linear-gradient(135deg, #0c1623 0%, #1a2332 100%);
            --bg-header: linear-gradient(90deg, #1e2a38 0%, #2d3748 100%);
            --bg-sidebar: linear-gradient(180deg, #1a2332 0%, #2d3748 100%);
            --bg-main: linear-gradient(180deg, #1a2332 0%, #2d3748 100%);
            --header-accent-line: transparent;
        }
        /* A. 漆黒系 (NHK放送局) */
        body[data-theme="dark-deep"] {
            --bg-page: #0a0e14;
            --bg-header: #14181f;
            --bg-sidebar: #0a0e14;
            --bg-main: #0a0e14;
            --header-accent-line: rgba(74, 158, 255, 0.18);
        }
        /* C. 純グレー(青み抜き) */
        body[data-theme="neutral-gray"] {
            --bg-page: #232323;
            --bg-header: #1a1a1a;
            --bg-sidebar: #232323;
            --bg-main: #232323;
            --header-accent-line: rgba(255, 255, 255, 0.12);
        }
        /* H. SOC/監視センター (ティール+黒) */
        body[data-theme="soc-teal"] {
            --bg-page: #001f23;
            --bg-header: #001517;
            --bg-sidebar: #001f23;
            --bg-main: #001f23;
            --header-accent-line: #00b4a3;
        }

        html, body {
            height: 100vh;
            font-family: 'SF Pro Display', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
            background: var(--bg-page);
            color: #ffffff;
            overflow: hidden;
        }
        
        /* === メインレイアウト === */
        .earthquake-dashboard {
            display: grid;
            grid-template-columns: 350px 1fr 400px;
            grid-template-rows: 70px 1fr;
            grid-template-areas:
                "header header header"
                "sidebar main rightpanel";
            height: 100vh;
            gap: 1px;
            background: #0a0f1a;
            transition: height 0.2s ease;
        }

        /* 津波テロップ表示中は、その高さ分だけダッシュボードを縮めて
           ズームコントロールや右パネル下部がテロップの裏に隠れないようにする */
        body.tsunami-ticker-active .earthquake-dashboard {
            height: calc(100vh - 46px);
        }
        
        /* === ヘッダー === */
        .main-header {
            grid-area: header;
            background: var(--bg-header);
            border-bottom: 1px solid var(--header-accent-line, rgba(74, 158, 255, 0.3));
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 24px;
            box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
        }
        
        .header-left {
            display: flex;
            align-items: center;
            gap: 16px;
        }
        
        .app-logo {
            width: 40px;
            height: 40px;
            background: linear-gradient(135deg, #4a9eff 0%, #667eea 100%);
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            font-weight: bold;
        }
        
        .app-title {
            font-size: 20px;
            font-weight: 700;
            color: #ffffff;
        }
        
        .header-center {
            display: flex;
            align-items: center;
            gap: 24px;
        }
        
        .connection-status {
            display: flex;
            align-items: center;
            gap: 12px;
            background: rgba(255, 255, 255, 0.05);
            padding: 8px 16px;
            border-radius: 20px;
            border: 1px solid rgba(255, 255, 255, 0.1);
        }
        
        .status-indicator {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 14px;
            font-weight: 500;
        }
        
        .status-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: #ff4757;
            animation: pulse 2s infinite;
        }
        
        .status-dot.connected {
            background: #2ed573;
        }
        
        .status-dot.partial {
            background: #ffa502;
            animation: pulse 1s infinite;
        }
        
        .reconnect-btn {
            background: none;
            border: none;
            font-size: 12px;
            cursor: pointer;
            padding: 2px 4px;
            border-radius: 3px;
            opacity: 0.7;
            transition: all 0.2s ease;
        }
        
        .reconnect-btn:hover {
            opacity: 1;
            background: rgba(255, 255, 255, 0.1);
            transform: rotate(180deg);
        }
        
        .reconnect-btn:active {
            transform: rotate(180deg) scale(0.9);
        }
        
        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.5; }
        }
        
        .header-right {
            display: flex;
            align-items: center;
            gap: 12px;
        }
        
        .current-time {
            font-family: 'SF Mono', 'Monaco', monospace;
            font-size: 16px;
            font-weight: 600;
            color: #4a9eff;
        }
        
        .settings-btn {
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            color: white;
            padding: 8px 16px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 500;
            transition: all 0.3s ease;
        }
        
        .settings-btn:hover {
            background: rgba(255, 255, 255, 0.2);
            transform: translateY(-1px);
        }

        /* === サイドバー === */
        .left-sidebar {
            grid-area: sidebar;
            background: var(--bg-sidebar);
            border-right: 1px solid rgba(255, 255, 255, 0.1);
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }
        
        .sidebar-section {
            padding: 20px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        }
        
        .section-title {
            font-size: 16px;
            font-weight: 600;
            color: #4a9eff;
            margin-bottom: 16px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        /* 最新地震情報のヘッダー（タイトル + 取得時刻 + 更新ボタン） */
        .earthquake-list-header {
            gap: 6px;
        }

        .earthquake-list-header .last-updated-label {
            font-size: 11px;
            color: #94a3b8;
            font-weight: 400;
        }

        .earthquake-list-header .last-updated {
            font-size: 11px;
            color: #94a3b8;
            font-weight: 400;
            font-family: 'SF Mono', monospace;
        }

        .earthquake-list-header .refresh-btn {
            margin-left: auto;
        }

        .refresh-btn {
            background: transparent;
            border: 1px solid rgba(74, 158, 255, 0.3);
            color: #4a9eff;
            width: 26px;
            height: 26px;
            border-radius: 6px;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 15px;
            line-height: 1;
            padding: 0;
            transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
        }

        .refresh-btn:hover {
            background: rgba(74, 158, 255, 0.15);
            border-color: rgba(74, 158, 255, 0.6);
        }

        .refresh-btn:active {
            transform: scale(0.95);
        }

        .refresh-btn.loading {
            pointer-events: none;
            opacity: 0.7;
        }

        .refresh-btn.loading > .refresh-icon {
            animation: refresh-spin 0.8s linear infinite;
        }

        .refresh-icon {
            display: inline-block;
        }

        @keyframes refresh-spin {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }
        
        .section-icon {
            font-size: 18px;
        }
        
        /* === EEW パネル === */
        .eew-panel {
            display: flex;
            flex-direction: column;
            gap: 6px;
        }

        /* 平常時: 1行のコンパクト待機表示 */
        .eew-compact {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 12px;
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 6px;
            font-size: 12px;
            color: #94a3b8;
        }

        .eew-mini-icon { font-size: 14px; opacity: 0.7; }
        .eew-mini-text { flex: 1; }
        .eew-mini-dot {
            width: 8px;
            height: 8px;
            background: #4ade80;
            border-radius: 50%;
            box-shadow: 0 0 6px rgba(74, 222, 128, 0.5);
            animation: eew-idle-pulse 2s ease-in-out infinite;
        }

        @keyframes eew-idle-pulse {
            0%, 100% { opacity: 0.5; }
            50% { opacity: 1; }
        }

        /* 発報中: compact 行は「続報待機中」＋赤ドットに変化 */
        .eew-panel.eew-active .eew-compact {
            border-color: rgba(255, 42, 42, 0.4);
            background: rgba(255, 42, 42, 0.08);
            color: #fca5a5;
        }

        .eew-panel.eew-active .eew-mini-dot {
            background: #ff2a2a;
            box-shadow: 0 0 8px rgba(255, 42, 42, 0.7);
            animation: eew-active-pulse 0.8s ease-in-out infinite;
        }

        @keyframes eew-active-pulse {
            0%, 100% { opacity: 0.55; }
            50%     { opacity: 1; }
        }

        /* hidden 属性が display:flex に上書きされないよう保険 */
        [hidden] { display: none !important; }

        /* 発信時: 展開されたアラート */
        .eew-alert {
            padding: 12px;
            border-radius: 8px;
            background: linear-gradient(135deg, rgba(255, 42, 42, 0.22) 0%, rgba(255, 107, 107, 0.14) 100%);
            border: 2px solid #ff2a2a;
            animation: eew-alert-pulse 1.2s ease-in-out infinite;
        }

        @keyframes eew-alert-pulse {
            0%, 100% { box-shadow: 0 0 0 0 rgba(255, 42, 42, 0.6); }
            50%     { box-shadow: 0 0 14px 4px rgba(255, 42, 42, 0.5); }
        }

        .eew-alert-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 8px;
        }

        .eew-badge {
            background: #ff2a2a;
            color: #fff;
            padding: 3px 8px;
            border-radius: 4px;
            font-size: 12px;
            font-weight: 700;
            letter-spacing: 0.5px;
        }

        .eew-serial {
            font-size: 11px;
            color: #fca5a5;
            font-family: 'SF Mono', monospace;
        }

        .eew-epicenter {
            font-size: 13px;
            font-weight: 700;
            color: #fff;
            margin-bottom: 8px;
            text-align: center;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .eew-alert-stats {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 6px;
            margin-bottom: 8px;
        }

        .eew-stat {
            text-align: center;
            padding: 6px 4px;
            background: rgba(0, 0, 0, 0.3);
            border-radius: 6px;
        }

        .eew-stat-label {
            font-size: 10px;
            color: #fca5a5;
            margin-bottom: 2px;
            line-height: 1.2;
        }

        .eew-stat-value {
            font-size: 16px;
            font-weight: 700;
            color: #fff;
            font-family: 'SF Mono', monospace;
            line-height: 1.2;
        }

        .eew-alert-footer {
            font-size: 10px;
            color: #fca5a5;
            text-align: center;
            font-family: 'SF Mono', monospace;
        }

        /* EEW 自宅情報（S波 ETA） */
        .eew-user-eta {
            margin-top: 8px;
            padding: 8px;
            background: rgba(0, 0, 0, 0.35);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 6px;
        }
        .eew-user-eta-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 12px;
            line-height: 1.4;
        }
        .eew-user-eta-row + .eew-user-eta-row {
            margin-top: 4px;
        }
        .eew-user-eta-label {
            color: #fca5a5;
        }
        .eew-user-eta-value {
            font-family: 'SF Mono', monospace;
            font-weight: 700;
            color: #fff;
        }
        .eew-user-eta-countdown {
            font-size: 16px;
            color: #ff6b6b;
        }
        .eew-user-eta-countdown.arrived {
            color: #94a3b8;
            font-size: 13px;
        }

        /* === EEW 画面ジャックオーバーレイ === */
        .eew-takeover {
            position: fixed;
            inset: 0;
            z-index: 99999;
            display: flex;
            flex-direction: column;
            align-items: stretch;
            justify-content: flex-start;
            background: radial-gradient(ellipse at center, rgba(220, 38, 38, 0.92) 0%, rgba(127, 29, 29, 0.96) 70%, rgba(60, 10, 10, 0.98) 100%);
            color: #fff;
            font-family: 'SF Pro Display', 'Inter', -apple-system, sans-serif;
            animation: eew-takeover-flash 0.6s ease-in-out infinite alternate;
            pointer-events: auto;
        }

        @keyframes eew-takeover-flash {
            0%   { background: radial-gradient(ellipse at center, rgba(220, 38, 38, 0.92) 0%, rgba(127, 29, 29, 0.96) 70%, rgba(60, 10, 10, 0.98) 100%); }
            100% { background: radial-gradient(ellipse at center, rgba(255, 80, 80, 0.96) 0%, rgba(180, 40, 40, 0.98) 70%, rgba(90, 15, 15, 1.00) 100%); }
        }

        .eew-takeover-bar {
            background: #000;
            color: #ffe14a;
            padding: 14px 28px;
            font-size: 28px;
            font-weight: 900;
            letter-spacing: 0.18em;
            text-align: center;
            border-bottom: 4px solid #ffe14a;
            box-shadow: 0 0 30px rgba(255, 225, 74, 0.6);
            animation: eew-bar-blink 0.8s steps(2) infinite;
        }

        @keyframes eew-bar-blink {
            0%, 50% { background: #000; color: #ffe14a; }
            51%, 100% { background: #ffe14a; color: #000; }
        }

        .eew-takeover-body {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 18px;
            padding: 24px;
            text-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
        }

        .eew-takeover-label {
            font-size: 22px;
            font-weight: 700;
            letter-spacing: 0.12em;
            opacity: 0.92;
        }

        .eew-takeover-epicenter {
            font-size: clamp(48px, 7vw, 96px);
            font-weight: 900;
            line-height: 1.05;
            letter-spacing: 0.04em;
            text-align: center;
            margin: 4px 0 12px 0;
        }

        .eew-takeover-stats {
            display: flex;
            gap: 48px;
            flex-wrap: wrap;
            justify-content: center;
            align-items: stretch;
            margin-top: 8px;
        }

        .eew-takeover-stat {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 6px;
            min-width: 180px;
        }

        .eew-takeover-stat-label {
            font-size: 16px;
            font-weight: 600;
            opacity: 0.8;
            letter-spacing: 0.1em;
        }

        .eew-takeover-stat-value {
            font-size: clamp(64px, 9vw, 128px);
            font-weight: 900;
            line-height: 1;
            font-family: 'SF Mono', 'Menlo', monospace;
            text-shadow: 0 6px 30px rgba(0, 0, 0, 0.8), 0 0 40px rgba(255, 230, 100, 0.4);
        }

        .eew-takeover-stat-value.intensity {
            color: #fff200;
            -webkit-text-stroke: 2px #000;
        }

        .eew-takeover-eta {
            margin-top: 24px;
            padding: 16px 32px;
            background: rgba(0, 0, 0, 0.55);
            border: 2px solid rgba(255, 255, 255, 0.5);
            border-radius: 8px;
            font-size: 24px;
            font-weight: 700;
            letter-spacing: 0.05em;
        }

        .eew-takeover-eta .eta-countdown {
            font-family: 'SF Mono', 'Menlo', monospace;
            font-size: 36px;
            color: #fff200;
            margin-left: 12px;
        }

        .eew-takeover-footer {
            padding: 12px 16px;
            font-size: 13px;
            opacity: 0.85;
            text-align: center;
            background: rgba(0, 0, 0, 0.4);
            letter-spacing: 0.08em;
        }

        .eew-takeover-close {
            position: absolute;
            top: 14px;
            right: 14px;
            background: rgba(0, 0, 0, 0.5);
            color: #fff;
            border: 1px solid rgba(255, 255, 255, 0.4);
            border-radius: 6px;
            padding: 8px 14px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
        }

        .eew-takeover-close:hover {
            background: rgba(255, 255, 255, 0.15);
        }

        /* 警報音停止ボタン (画面ジャック内) */
        .eew-takeover-mute {
            position: absolute;
            top: 14px;
            right: 130px;
            background: #000;
            color: #ffe14a;
            border: 2px solid #ffe14a;
            border-radius: 6px;
            padding: 8px 16px;
            font-size: 14px;
            font-weight: 700;
            letter-spacing: 0.05em;
            cursor: pointer;
            box-shadow: 0 0 16px rgba(255, 225, 74, 0.4);
        }

        .eew-takeover-mute:hover {
            background: #ffe14a;
            color: #000;
        }

        .eew-takeover-mute.muted {
            background: rgba(0, 0, 0, 0.4);
            color: rgba(255, 255, 255, 0.5);
            border-color: rgba(255, 255, 255, 0.3);
            box-shadow: none;
            cursor: default;
        }

        /* 縮小モード時はボタン位置を調整 */
        .eew-takeover.minimized .eew-takeover-mute {
            top: 6px;
            right: 92px;
            padding: 4px 10px;
            font-size: 12px;
            box-shadow: none;
        }
        .eew-takeover.minimized .eew-takeover-close {
            top: 6px;
            right: 10px;
            padding: 4px 10px;
            font-size: 12px;
        }

        /* 縮小モード(自動5秒経過後) — 上部バー型に変形 */
        .eew-takeover.minimized {
            inset: 0 0 auto 0;
            height: auto;
            animation: none;
            background: linear-gradient(90deg, rgba(127, 29, 29, 0.97) 0%, rgba(220, 38, 38, 0.95) 50%, rgba(127, 29, 29, 0.97) 100%);
            border-bottom: 3px solid #ffe14a;
        }

        .eew-takeover.minimized .eew-takeover-bar {
            font-size: 16px;
            padding: 8px 18px;
            border-bottom: none;
            box-shadow: none;
            animation: none;
            background: transparent;
            color: #ffe14a;
            display: inline-block;
        }

        .eew-takeover.minimized .eew-takeover-body {
            flex-direction: row;
            padding: 8px 18px;
            gap: 18px;
            justify-content: flex-start;
            align-items: center;
            flex-wrap: wrap;
        }

        .eew-takeover.minimized .eew-takeover-label { display: none; }
        .eew-takeover.minimized .eew-takeover-epicenter { font-size: 18px; margin: 0; }
        .eew-takeover.minimized .eew-takeover-stats { gap: 18px; }
        .eew-takeover.minimized .eew-takeover-stat { flex-direction: row; gap: 8px; min-width: auto; }
        .eew-takeover.minimized .eew-takeover-stat-label { font-size: 12px; }
        .eew-takeover.minimized .eew-takeover-stat-value { font-size: 22px; -webkit-text-stroke: 0; }
        .eew-takeover.minimized .eew-takeover-eta { margin: 0; padding: 4px 10px; font-size: 13px; }
        .eew-takeover.minimized .eew-takeover-eta .eta-countdown { font-size: 16px; margin-left: 6px; }
        .eew-takeover.minimized .eew-takeover-footer { display: none; }

        /* === TV放送風 震度分布モーダル === */
        .tv-intensity-modal {
            position: fixed;
            inset: 0;
            z-index: 9998;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(0, 0, 0, 0.78);
            backdrop-filter: blur(4px);
            animation: tv-modal-fadein 0.18s ease-out;
        }

        @keyframes tv-modal-fadein {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        .tv-intensity-panel {
            width: min(88vw, 1100px);
            height: min(86vh, 800px);
            background: #1a3d8f; /* 海の青を基調 */
            border: 4px solid #0a1f4f;
            border-radius: 6px;
            box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            position: relative;
        }

        .tv-intensity-header {
            display: flex;
            align-items: stretch;
            background: linear-gradient(180deg, #2a5fc8 0%, #1e4a9e 100%);
            border-bottom: 3px solid #0a1f4f;
        }

        .tv-intensity-header-time {
            flex: 1;
            padding: 14px 22px;
            color: #ffffff;
            font-size: 28px;
            font-weight: 900;
            letter-spacing: 0.05em;
            text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
            font-family: 'SF Pro Display', 'Hiragino Sans', sans-serif;
            border-right: 2px solid #0a1f4f;
        }

        .tv-intensity-header-mag {
            min-width: 220px;
            padding: 14px 110px 14px 22px; /* 右側に閉じるボタン分の余白を確保 */
            color: #fff200;
            font-size: 36px;
            font-weight: 900;
            letter-spacing: 0.04em;
            text-align: center;
            text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
            font-family: 'SF Pro Display', monospace;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .tv-intensity-subheader {
            padding: 8px 22px;
            background: #0a1f4f;
            color: #fff;
            font-size: 16px;
            font-weight: 600;
            letter-spacing: 0.05em;
            border-bottom: 2px solid #03102e;
        }

        .tv-intensity-subheader .epicenter-name {
            color: #fff200;
            font-weight: 900;
            font-size: 18px;
            margin: 0 8px;
        }

        .tv-intensity-map-wrap {
            flex: 1;
            position: relative;
            background: #1a3d8f;
        }

        .tv-intensity-map {
            width: 100%;
            height: 100%;
        }

        /* TV風: 海を青、陸を茶系に — Voyager タイルに弱めのフィルタで TV 放送風カラーへ */
        .tv-intensity-map .leaflet-container {
            background: #1a3d8f !important; /* 海の青(タイル外領域) */
        }
        .tv-intensity-map .leaflet-tile {
            /* 海(水色)は維持しつつ、陸を茶色寄りに引き寄せる */
            filter: saturate(1.3) hue-rotate(-8deg) contrast(1.1) brightness(0.92);
        }

        /* 震度バッジ (DivIcon内) — 縦組み: 上に地名ラベル、下に震度数字 */
        .intensity-badge-wrap {
            display: flex;
            flex-direction: column;
            align-items: center;
            line-height: 1;
            text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.6);
        }
        .intensity-badge-pref {
            font-size: 11px;
            font-weight: 700;
            color: #fff;
            background: rgba(0, 0, 0, 0.82);
            padding: 1px 5px;
            border-radius: 2px;
            margin-bottom: 1px;
            white-space: nowrap;
            font-family: 'Hiragino Sans', sans-serif;
            letter-spacing: 0.02em;
        }
        /* 市町村バッジは少し小さめのラベル */
        .intensity-badge-wrap.city .intensity-badge-pref {
            font-size: 10px;
            padding: 1px 4px;
        }
        .intensity-badge {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 26px;
            height: 26px;
            font-family: 'Hiragino Sans', 'SF Pro Display', sans-serif;
            font-size: 16px;
            font-weight: 900;
            border: 2px solid rgba(0, 0, 0, 0.85);
            box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
            color: #000;
            line-height: 1;
            border-radius: 2px;
        }
        .intensity-badge.intensity-1 { background: #4287ff; color: #fff; }
        .intensity-badge.intensity-2 { background: #5fcf4a; color: #000; }
        .intensity-badge.intensity-3 { background: #f5e94a; color: #000; }
        .intensity-badge.intensity-4 { background: #ff8c1a; color: #000; }
        .intensity-badge.intensity-5w { background: #ff4a3d; color: #fff; }
        .intensity-badge.intensity-5s { background: #d61f1f; color: #fff; }
        .intensity-badge.intensity-6w { background: #a01818; color: #fff; }
        .intensity-badge.intensity-6s { background: #6b0000; color: #fff; }
        .intensity-badge.intensity-7  { background: #4a0080; color: #fff; }

        /* 震源マーカー (黄縁の赤×) */
        .epicenter-marker {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 38px;
            height: 38px;
            font-size: 30px;
            font-weight: 900;
            color: #d61f1f;
            text-shadow:
                -2px -2px 0 #fff200, 2px -2px 0 #fff200,
                -2px 2px 0 #fff200, 2px 2px 0 #fff200,
                0 0 4px rgba(0, 0, 0, 0.6);
            font-family: sans-serif;
        }

        /* 震度凡例 */
        .tv-intensity-legend {
            position: absolute;
            bottom: 12px;
            left: 12px;
            display: flex;
            gap: 4px;
            background: rgba(10, 31, 79, 0.92);
            padding: 6px 8px;
            border: 1px solid #fff200;
            border-radius: 3px;
            font-size: 11px;
            color: #fff;
            align-items: center;
        }
        .tv-intensity-legend .legend-label { margin-right: 6px; font-weight: 700; }
        .tv-intensity-legend .legend-cell {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 22px; height: 22px;
            font-weight: 900;
            border: 1.5px solid rgba(0, 0, 0, 0.7);
            font-size: 13px;
        }

        .tv-intensity-close {
            position: absolute;
            top: 14px;
            right: 14px;
            background: rgba(0, 0, 0, 0.7);
            color: #fff;
            border: 1px solid rgba(255, 255, 255, 0.5);
            border-radius: 4px;
            padding: 6px 12px;
            font-size: 13px;
            font-weight: 700;
            cursor: pointer;
            z-index: 10;
            line-height: 1.2;
        }

        .tv-intensity-close:hover {
            background: #d61f1f;
            border-color: #fff200;
        }

        /* 地点別震度リスト (バッジ クリック時の popup) */
        .tv-intensity-popup .leaflet-popup-content-wrapper {
            background: #0a1f4f;
            color: #fff;
            border: 2px solid #fff200;
            border-radius: 4px;
            padding: 0;
        }
        .tv-intensity-popup .leaflet-popup-content {
            margin: 0;
            min-width: 220px;
        }
        .tv-intensity-popup .leaflet-popup-tip {
            background: #0a1f4f;
            border: 2px solid #fff200;
        }
        .tv-popup-header {
            background: #1e4a9e;
            color: #fff200;
            padding: 8px 12px;
            font-size: 14px;
            font-weight: 900;
            border-bottom: 1px solid #fff200;
        }
        .tv-popup-list {
            list-style: none;
            margin: 0;
            padding: 6px 0;
            max-height: 240px;
            overflow-y: auto;
        }
        .tv-popup-list li {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            padding: 4px 12px;
            font-size: 12px;
        }
        .tv-popup-list li + li {
            border-top: 1px solid rgba(255, 255, 255, 0.08);
        }
        .tv-popup-addr {
            color: #fff;
            flex: 1;
        }
        .tv-popup-scale {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 22px;
            height: 22px;
            font-weight: 900;
            font-size: 12px;
            border: 1.5px solid rgba(0, 0, 0, 0.7);
            border-radius: 2px;
            flex-shrink: 0;
        }

        .tv-intensity-no-data {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fff;
            font-size: 18px;
            background: rgba(10, 31, 79, 0.6);
            text-align: center;
            padding: 24px;
        }

        /* 自宅マーカーのカスタムアイコン */
        .user-location-icon {
            background: transparent !important;
            border: none !important;
        }

        /* 位置情報削除ボタン（設定済みのときだけ表示） */
        .location-clear-btn {
            padding: 8px 10px !important;
        }
        
        /* 統計情報 */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 6px;
        }

        .stat-card {
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 6px;
            padding: 8px 4px;
            text-align: center;
        }

        .stat-value {
            font-size: 15px;
            font-weight: 700;
            color: #4a9eff;
            font-family: 'SF Mono', monospace;
            line-height: 1.2;
        }

        .stat-label {
            font-size: 10px;
            color: #94a3b8;
            margin-top: 2px;
            line-height: 1.2;
        }
        
        /* 最新地震リスト（テーブル行レイアウト） */
        .earthquake-list {
            flex: 1;
            overflow-y: auto;
            padding: 12px 12px 8px;
        }

        .earthquake-item {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 6px 8px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.06);
            cursor: pointer;
            transition: background 0.15s ease;
        }

        .earthquake-item:hover {
            background: rgba(255, 255, 255, 0.06);
        }

        .earthquake-item:last-child {
            border-bottom: none;
        }

        .earthquake-header {
            display: flex;
            gap: 4px;
            flex-shrink: 0;
        }

        .magnitude {
            background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
            color: white;
            padding: 1px 6px;
            border-radius: 10px;
            font-size: 11px;
            font-weight: 600;
            min-width: 44px;
            text-align: center;
            font-family: 'SF Mono', monospace;
        }

        .intensity {
            background: linear-gradient(135deg, #4a9eff 0%, #667eea 100%);
            color: white;
            padding: 1px 6px;
            border-radius: 10px;
            font-size: 11px;
            font-weight: 600;
            min-width: 52px;
            text-align: center;
        }

        .earthquake-location {
            flex: 1;
            font-size: 13px;
            font-weight: 500;
            color: #ffffff;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            min-width: 0;
        }

        .earthquake-time {
            font-size: 11px;
            color: #94a3b8;
            font-family: 'SF Mono', monospace;
            flex-shrink: 0;
        }
        
        /* === メイン地図エリア === */
        .main-content {
            grid-area: main;
            background: var(--bg-main);
            position: relative;
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }

        .map-container {
            width: 100%;
            height: 280px;
            position: relative;
            flex-shrink: 0;
            cursor: pointer;
            transition: height 0.3s ease;
        }

        .main-content.map-expanded .map-container {
            flex: 1;
            height: auto;
            cursor: default;
        }

        .main-content.map-expanded .info-dashboard {
            display: none;
        }

        /* コンパクト時は地図右下の情報オーバーレイを隠す（サイドバー/ダッシュボードに情報あり） */
        .main-content:not(.map-expanded) .map-overlay {
            display: none;
        }

        /* コンパクト時は津波凡例を隠す（狭い領域を圧迫するため・右パネルに同情報あり） */
        .main-content:not(.map-expanded) .jma-tsunami-legend {
            display: none;
        }

        #earthquake-map {
            width: 100%;
            height: 100%;
            background: #0f1419;
        }

        /* ダーク(控えめ)レイヤーに対し、陸地を持ち上げ + 青色注入で左右パネルと色相統一 */
        /* sepia で擬似的に色を付与した上で hue-rotate(180deg) で青寄りに反転 */
        .leaflet-layer.dark-subtle {
            filter: brightness(1.45) contrast(1.05) sepia(0.5) hue-rotate(175deg) saturate(1.3);
        }

        .map-toggle-btn {
            position: absolute;
            top: 12px;
            right: 12px;
            z-index: 1000;
            background: rgba(26, 35, 50, 0.92);
            color: #ffffff;
            border: 1px solid rgba(74, 158, 255, 0.4);
            border-radius: 6px;
            padding: 6px 10px;
            cursor: pointer;
            font-size: 12px;
            font-weight: 600;
            backdrop-filter: blur(10px);
            transition: background 0.2s ease, border-color 0.2s ease;
        }

        .map-toggle-btn:hover {
            background: rgba(74, 158, 255, 0.3);
            border-color: rgba(74, 158, 255, 0.7);
        }

        /* === 地図マーカーの期間フィルター（左上トグル） === */
        .map-period-filter {
            position: absolute;
            top: 12px;
            left: 12px;
            z-index: 1000;
            display: flex;
            gap: 4px;
            padding: 4px;
            background: rgba(26, 35, 50, 0.92);
            border: 1px solid rgba(74, 158, 255, 0.4);
            border-radius: 6px;
            backdrop-filter: blur(10px);
        }

        .map-period-filter .period-btn {
            background: transparent;
            color: rgba(255, 255, 255, 0.75);
            border: 1px solid transparent;
            border-radius: 4px;
            padding: 4px 8px;
            cursor: pointer;
            font-size: 11px;
            font-weight: 600;
            white-space: nowrap;
            transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
        }

        .map-period-filter .period-btn:hover {
            background: rgba(74, 158, 255, 0.2);
            color: #ffffff;
        }

        .map-period-filter .period-btn.active {
            background: rgba(74, 158, 255, 0.35);
            color: #ffffff;
            border-color: rgba(74, 158, 255, 0.7);
        }

        /* === 地図/ダッシュボード境界のリサイズハンドル === */
        .map-resize-handle {
            height: 6px;
            background: rgba(74, 158, 255, 0.12);
            border-top: 1px solid rgba(74, 158, 255, 0.25);
            border-bottom: 1px solid rgba(0, 0, 0, 0.25);
            cursor: ns-resize;
            flex-shrink: 0;
            position: relative;
            transition: background 0.15s ease, height 0.15s ease;
        }
        .map-resize-handle:hover,
        .map-resize-handle.dragging {
            background: rgba(74, 158, 255, 0.4);
            height: 8px;
        }
        /* ハンドル中央に「掴み」インジケータ */
        .map-resize-handle::after {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 44px;
            height: 2px;
            background: rgba(255, 255, 255, 0.35);
            border-radius: 1px;
            pointer-events: none;
        }
        /* マップ拡大モードでは情報ダッシュボードが消えるためハンドルも不要 */
        .main-content.map-expanded .map-resize-handle {
            display: none;
        }

        /* === 情報ダッシュボード（地図下部） === */
        .info-dashboard {
            flex: 1;
            overflow-y: auto;
            padding: 14px;
            background: transparent;
            border-top: 1px solid rgba(74, 158, 255, 0.08);
        }

        .info-dashboard-title {
            font-size: 13px;
            font-weight: 600;
            color: #4a9eff;
            margin-bottom: 10px;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .chart-period {
            font-size: 11px;
            color: #94a3b8;
            font-weight: 400;
            margin-left: auto;
        }

        .frequency-chart {
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            padding: 10px 12px;
        }

        .chart-row {
            display: flex;
            align-items: center;
            gap: 8px;
            height: 22px;
            margin-bottom: 3px;
        }

        .chart-row:last-child { margin-bottom: 0; }

        .chart-row-label {
            width: 46px;
            font-size: 11px;
            color: #e2e8f0;
            font-weight: 600;
            flex-shrink: 0;
            text-align: right;
            font-family: 'SF Mono', monospace;
        }

        .chart-row-track {
            flex: 1;
            height: 16px;
            background: rgba(255, 255, 255, 0.04);
            border-radius: 4px;
            overflow: hidden;
        }

        .chart-row-fill {
            height: 100%;
            transition: width 0.5s ease;
            border-radius: 4px;
            min-width: 2px;
        }

        .chart-row-count {
            width: 28px;
            font-size: 11px;
            color: #ffffff;
            font-weight: 700;
            text-align: right;
            flex-shrink: 0;
            font-family: 'SF Mono', monospace;
        }

        .chart-empty {
            text-align: center;
            color: #94a3b8;
            font-size: 12px;
            padding: 16px 8px;
        }
        
        .map-overlay {
            position: absolute;
            bottom: 20px;
            right: 20px;
            background: rgba(45, 55, 72, 0.92);
            backdrop-filter: blur(15px);
            border: 1px solid rgba(74, 158, 255, 0.2);
            border-radius: 12px;
            padding: 16px;
            min-width: 280px;
            z-index: 1000;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
        }
        
        .overlay-title {
            font-size: 16px;
            font-weight: 600;
            color: #74b9ff;
            margin-bottom: 12px;
            text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
        }
        
        .coordinate-info {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 6px;
        }

        .coord-item {
            text-align: center;
            padding: 6px 2px;
            background: rgba(255, 255, 255, 0.03);
            border-radius: 6px;
        }

        .coord-label {
            font-size: 10px;
            color: #a0aec0;
            margin-bottom: 2px;
            line-height: 1.2;
        }

        .coord-value {
            font-size: 12px;
            font-weight: 600;
            color: #f7fafc;
            font-family: 'SF Mono', monospace;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
            line-height: 1.2;
        }
        
        /* === 右パネル === */
        .right-panel {
            grid-area: rightpanel;
            background: var(--bg-sidebar);
            border-left: 1px solid rgba(255, 255, 255, 0.1);
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }
        
        .panel-header {
            padding: 20px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }
        
        .panel-title {
            font-size: 18px;
            font-weight: 600;
            color: #ffffff;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .live-indicator {
            background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
            color: white;
            padding: 4px 8px;
            border-radius: 12px;
            font-size: 10px;
            font-weight: 600;
            text-transform: uppercase;
            animation: live-pulse 2s infinite;
        }
        
        @keyframes live-pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.7; }
        }
        
        .monitoring-panel {
            flex: 1;
            padding: 14px;
            overflow-y: auto;
        }

        .monitoring-section {
            margin-bottom: 16px;
        }
        
        .monitoring-title {
            font-size: 14px;
            font-weight: 600;
            color: #4a9eff;
            margin-bottom: 12px;
        }

        /* === 津波警報パネル === */
        .tsunami-warning-panel {
            background: linear-gradient(135deg, rgba(255, 69, 0, 0.1) 0%, rgba(255, 140, 0, 0.05) 100%);
            border: 1px solid rgba(255, 69, 0, 0.3);
            border-radius: 12px;
            padding: 16px;
            margin-bottom: 16px;
        }

        .tsunami-status {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 16px;
        }

        .tsunami-level {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 12px;
            border-radius: 8px;
            font-weight: 600;
            font-size: 14px;
        }

        .tsunami-level.major-warning {
            background: rgba(139, 0, 0, 0.2);
            border: 1px solid #8B0000;
            color: #FF6B6B;
        }

        .tsunami-level.warning {
            background: rgba(255, 69, 0, 0.2);
            border: 1px solid #FF4500;
            color: #FFB347;
        }

        .tsunami-level.advisory {
            background: rgba(255, 215, 0, 0.2);
            border: 1px solid #FFD700;
            color: #FFFF8C;
        }

        .level-indicator {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            animation: pulse 2s infinite;
        }

        .tsunami-level.major-warning .level-indicator {
            background: #8B0000;
        }

        .tsunami-level.warning .level-indicator {
            background: #FF4500;
        }

        .tsunami-level.advisory .level-indicator {
            background: #FFD700;
        }

        .tsunami-time {
            font-size: 12px;
            color: #a0a9b8;
        }

        .tsunami-regions {
            margin-bottom: 16px;
            max-height: 260px;
            overflow-y: auto;
            padding-right: 4px;
        }

        .region-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px;
            margin-bottom: 8px;
            border-radius: 8px;
            border-left: 4px solid;
            background: rgba(255, 255, 255, 0.02);
        }

        .region-item.major-warning {
            border-left-color: #8B0000;
            background: rgba(139, 0, 0, 0.05);
        }

        .region-item.warning {
            border-left-color: #FF4500;
            background: rgba(255, 69, 0, 0.05);
        }

        .region-item.advisory {
            border-left-color: #FFD700;
            background: rgba(255, 215, 0, 0.05);
        }

        .region-name {
            font-size: 13px;
            font-weight: 500;
            color: #ffffff;
        }

        .region-info {
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            gap: 2px;
        }

        .wave-height {
            font-size: 14px;
            font-weight: 700;
            color: #4a9eff;
        }

        .arrival-time {
            font-size: 11px;
            color: #a0a9b8;
        }

        .tsunami-actions {
            display: flex;
            gap: 8px;
        }

        .action-btn {
            flex: 1;
            padding: 8px 12px;
            background: rgba(74, 158, 255, 0.1);
            border: 1px solid rgba(74, 158, 255, 0.3);
            border-radius: 6px;
            color: #4a9eff;
            font-size: 11px;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .action-btn:hover {
            background: rgba(74, 158, 255, 0.2);
            border-color: rgba(74, 158, 255, 0.5);
        }

        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.3; }
        }
        
        .real-time-clock {
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            padding: 16px;
            text-align: center;
            margin-bottom: 16px;
        }
        
        .clock-display {
            font-size: 24px;
            font-weight: 700;
            color: #4a9eff;
            font-family: 'SF Mono', monospace;
        }
        
        .clock-date {
            font-size: 14px;
            color: #94a3b8;
            margin-top: 4px;
        }
        
        .metrics-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 6px;
        }

        .metric-card {
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 6px;
            padding: 8px 4px;
            text-align: center;
        }

        .metric-value {
            font-size: 13px;
            font-weight: 700;
            color: #ffffff;
            font-family: 'SF Mono', monospace;
            line-height: 1.2;
        }

        .metric-label {
            font-size: 9px;
            color: #94a3b8;
            margin-top: 2px;
            text-transform: uppercase;
            letter-spacing: 0.3px;
            line-height: 1.2;
        }
        
        .activity-feed {
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            max-height: 200px;
            overflow-y: auto;
        }

        /* === 余震確率表 === */
        .aftershock-note {
            font-size: 10px;
            color: #94a3b8;
            font-weight: 400;
            margin-left: 4px;
        }

        .aftershock-panel {
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            padding: 10px;
        }

        .aftershock-empty {
            color: #94a3b8;
            font-size: 11px;
            text-align: center;
            padding: 8px 4px;
        }

        .aftershock-mainshock {
            font-size: 11px;
            color: #e2e8f0;
            margin-bottom: 8px;
            padding-bottom: 6px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        }

        .aftershock-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 11px;
        }

        .aftershock-table th {
            color: #94a3b8;
            font-weight: 500;
            text-align: center;
            padding: 3px 2px;
            font-family: 'SF Mono', monospace;
        }

        .aftershock-table td {
            text-align: center;
            padding: 4px 2px;
            font-family: 'SF Mono', monospace;
        }

        .aftershock-table td.row-label {
            color: #e2e8f0;
            font-weight: 600;
            text-align: left;
        }

        .aftershock-table td.prob {
            color: #ffffff;
            font-weight: 700;
        }

        .aftershock-table td.prob.high {
            color: #ff6b6b;
        }

        .aftershock-table td.prob.mid {
            color: #fbbf24;
        }

        .aftershock-table td.prob.low {
            color: #94a3b8;
        }

        .aftershock-footer {
            font-size: 9px;
            color: #64748b;
            text-align: right;
            margin-top: 6px;
        }
        
        .feed-item {
            padding: 6px 10px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .feed-item:last-child {
            border-bottom: none;
        }
        
        .feed-icon {
            font-size: 14px;
            flex-shrink: 0;
        }

        .feed-content {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            min-width: 0;
        }

        .feed-text {
            font-size: 12px;
            color: #ffffff;
            line-height: 1.3;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            flex: 1;
            min-width: 0;
        }

        .feed-time {
            font-size: 10px;
            color: #94a3b8;
            font-family: 'SF Mono', monospace;
            flex-shrink: 0;
        }
        
        /* 震源位置情報パネル */
        .earthquake-info-panel {
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(74, 158, 255, 0.2);
            border-radius: 12px;
            padding: 16px;
        }
        
        /* === カスタムスクロールバー === */
        ::-webkit-scrollbar {
            width: 6px;
        }
        
        ::-webkit-scrollbar-track {
            background: rgba(255, 255, 255, 0.05);
        }
        
        ::-webkit-scrollbar-thumb {
            background: linear-gradient(135deg, #4a9eff 0%, #667eea 100%);
            border-radius: 3px;
        }
        
        /* === レスポンシブ対応 === */
        @media (max-width: 1200px) {
            .earthquake-dashboard {
                grid-template-columns: 300px 1fr 350px;
            }
        }
        
        @media (max-width: 768px) {
            .earthquake-dashboard {
                grid-template-columns: 1fr;
                grid-template-rows: 70px 1fr;
                grid-template-areas: 
                    "header"
                    "main";
            }
            
            .left-sidebar,
            .right-panel {
                display: none;
            }
        }
        
        /* === アニメーション === */
        .fade-in {
            animation: fadeIn 0.5s ease-in-out;
        }
        
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }
        
        /* === 震度情報ポップアップ === */
        .intensity-popup {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: rgba(30, 42, 56, 0.98);
            border: 2px solid rgba(74, 158, 255, 0.4);
            border-radius: 16px;
            padding: 24px;
            max-width: 920px;
            width: min(92vw, 920px);
            max-height: 86vh;
            display: flex;
            flex-direction: column;
            max-height: 600px;
            overflow-y: auto;
            z-index: 10000;
            backdrop-filter: blur(20px);
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
            animation: popupSlideIn 0.3s ease-out;
        }
        
        @keyframes popupSlideIn {
            from { 
                opacity: 0; 
                transform: translate(-50%, -60%) scale(0.9); 
            }
            to { 
                opacity: 1; 
                transform: translate(-50%, -50%) scale(1); 
            }
        }
        
        .popup-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            padding-bottom: 12px;
            border-bottom: 1px solid rgba(74, 158, 255, 0.3);
        }
        
        .popup-title {
            font-size: 18px;
            font-weight: 700;
            color: #74b9ff;
            margin: 0;
        }
        
        .popup-close {
            background: rgba(255, 107, 107, 0.2);
            border: 1px solid rgba(255, 107, 107, 0.4);
            color: #ff6b6b;
            border-radius: 50%;
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            font-size: 16px;
            font-weight: bold;
            transition: all 0.3s ease;
        }
        
        .popup-close:hover {
            background: rgba(255, 107, 107, 0.3);
            transform: scale(1.1);
        }
        
        .earthquake-summary {
            background: rgba(74, 158, 255, 0.1);
            border: 1px solid rgba(74, 158, 255, 0.3);
            border-radius: 12px;
            padding: 16px;
            margin-bottom: 20px;
        }
        
        .summary-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 12px;
            margin-top: 12px;
        }
        
        .summary-item {
            text-align: center;
        }
        
        .summary-label {
            font-size: 12px;
            color: #a0aec0;
            margin-bottom: 4px;
        }
        
        .summary-value {
            font-size: 16px;
            font-weight: 600;
            color: #f7fafc;
            font-family: 'SF Mono', monospace;
        }
        
        .intensity-list {
            flex: 1;
            min-height: 0;
            overflow-y: auto;
            padding-right: 4px;
        }

        .intensity-section {
            margin-bottom: 12px;
        }
        
        .intensity-header {
            background: linear-gradient(135deg, #4a9eff 0%, #667eea 100%);
            color: white;
            padding: 8px 12px;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 600;
            margin-bottom: 8px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .intensity-regions {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 4px 6px;
            margin-left: 12px;
        }
        @media (max-width: 720px) {
            .intensity-regions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        }
        @media (max-width: 480px) {
            .intensity-regions { grid-template-columns: 1fr; }
        }

        .region-item {
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 5px;
            padding: 4px 8px;
            font-size: 12px;
            color: #e2e8f0;
            transition: all 0.2s ease;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        
        .region-item:hover {
            background: rgba(255, 255, 255, 0.1);
            transform: translateX(2px);
        }
        
        .popup-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.7);
            z-index: 9999;
            animation: fadeInOverlay 0.3s ease-out;
        }
        
        @keyframes fadeInOverlay {
            from { opacity: 0; }
            to { opacity: 1; }
        }
        
        /* === 設定パネル === */
        .settings-panel {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: rgba(30, 42, 56, 0.98);
            border: 2px solid rgba(74, 158, 255, 0.4);
            border-radius: 16px;
            padding: 24px;
            width: 600px;
            max-width: 90vw;
            max-height: 700px;
            overflow-y: auto;
            z-index: 10000;
            backdrop-filter: blur(20px);
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
            animation: popupSlideIn 0.3s ease-out;
        }
        
        .settings-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 24px;
            padding-bottom: 12px;
            border-bottom: 1px solid rgba(74, 158, 255, 0.3);
        }
        
        .settings-title {
            font-size: 20px;
            font-weight: 700;
            color: #74b9ff;
            margin: 0;
        }
        
        .settings-section {
            margin-bottom: 24px;
        }
        
        .settings-section-title {
            font-size: 16px;
            font-weight: 600;
            color: #4a9eff;
            margin-bottom: 12px;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: all 0.3s ease;
        }
        
        .settings-section-title:hover {
            color: #74b9ff;
            transform: translateX(2px);
        }
        
        .activity-feed-settings {
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 12px;
            max-height: 300px;
            overflow-y: auto;
        }
        
        .map-layers-settings {
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(74, 158, 255, 0.2);
            border-radius: 12px;
            padding: 16px;
            width: 100%;
            box-sizing: border-box;
        }
        
        .layer-option {
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            padding: 12px;
            margin-bottom: 8px;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .layer-option:hover {
            background: rgba(255, 255, 255, 0.1);
            transform: translateX(2px);
        }
        
        .layer-option.active {
            background: linear-gradient(135deg, #4a9eff 0%, #667eea 100%);
            border-color: rgba(74, 158, 255, 0.5);
            color: white;
        }
        
        .layer-option-name {
            font-size: 14px;
            font-weight: 500;
            min-width: 160px;
            flex: 1;
        }
        
        .layer-option-status {
            font-size: 12px;
            color: #74b9ff;
            font-weight: 600;
            min-width: 60px;
            text-align: right;
            white-space: nowrap;
        }
        
        .layer-option.active .layer-option-status {
            color: white;
        }
        
        .slide-in-left {
            animation: slideInLeft 0.3s ease-out;
        }
        
        @keyframes slideInLeft {
            from { transform: translateX(-20px); opacity: 0; }
            to { transform: translateX(0); opacity: 1; }
        }
        
        /* === ローディング状態 === */
        .loading {
            display: flex;
            align-items: center;
            justify-content: center;
            height: 100%;
            flex-direction: column;
            gap: 16px;
        }
        
        .loading-spinner {
            width: 40px;
            height: 40px;
            border: 3px solid rgba(74, 158, 255, 0.3);
            border-top: 3px solid #4a9eff;
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }
        
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        
        .loading-text {
            color: #94a3b8;
            font-size: 14px;
        }
        
        /* Leaflet マップスタイルのカスタマイズ */
        .leaflet-container {
            background: #0f1419;
            border-radius: 8px;
        }

        /* 夜間モード（v3.3.1 修正）: body クラスで全体を暗化、map にも追加で filter */
        body.night-mode {
            filter: brightness(0.55) contrast(1.05);
            transition: filter 0.3s ease;
        }
        body.night-mode .leaflet-container {
            filter: brightness(0.7);
        }
        
        /* ズームコントロールのみにfilterを適用 */
        .leaflet-control-zoom {
            filter: invert(1) hue-rotate(180deg);
        }
        
        /* レイヤーコントロールのスタイル - 確実な可視性 */
        .leaflet-control-layers {
            background: rgba(30, 42, 56, 0.95) !important;
            color: white !important;
            border: 1px solid rgba(74, 158, 255, 0.3) !important;
            border-radius: 8px !important;
            backdrop-filter: blur(10px) !important;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
            display: block !important;
            visibility: visible !important;
            opacity: 1 !important;
            z-index: 2000 !important;
            min-width: 180px !important;
            padding: 8px !important;
        }
        
        .leaflet-control-layers-expanded {
            display: block !important;
            visibility: visible !important;
            opacity: 1 !important;
        }
        
        .leaflet-control-layers-list {
            color: white !important;
            padding: 8px 0 !important;
        }
        
        .leaflet-control-layers-toggle {
            background-image: none !important;
            background-color: rgba(74, 158, 255, 0.9) !important;
            border-radius: 6px !important;
            width: 36px !important;
            height: 36px !important;
            border: 2px solid rgba(255, 255, 255, 0.3) !important;
            position: relative !important;
            display: block !important;
            visibility: visible !important;
            opacity: 1 !important;
        }
        
        .leaflet-control-layers-toggle::before {
            content: '🗺️';
            color: white !important;
            font-size: 16px !important;
            position: absolute !important;
            top: 50% !important;
            left: 50% !important;
            transform: translate(-50%, -50%) !important;
            line-height: 1 !important;
            z-index: 2001 !important;
            pointer-events: none !important;
        }
        
        .leaflet-control-layers-toggle:hover {
            background-color: rgba(74, 158, 255, 1) !important;
            transform: scale(1.05) !important;
        }
        
        .leaflet-popup-content-wrapper {
            background: rgba(15, 20, 25, 0.95);
            color: white;
            border-radius: 8px;
            backdrop-filter: blur(10px);
            border: 1px solid rgba(74, 158, 255, 0.3);
        }
        
        .leaflet-popup-tip {
            background: rgba(15, 20, 25, 0.95);
        }
        
        .japan-region-tooltip {
            background: rgba(74, 158, 255, 0.9) !important;
            color: white !important;
            border: 1px solid rgba(74, 158, 255, 0.5) !important;
            border-radius: 4px !important;
            font-size: 12px !important;
            font-weight: 500 !important;
            padding: 4px 8px !important;
        }
        
        /* 地震マーカーの強調 */
        .earthquake-marker {
            border: 2px solid rgba(255, 255, 255, 0.8) !important;
            box-shadow: 0 0 10px rgba(255, 255, 255, 0.5) !important;
        }
        

        
        .standard-map-layer {
            transition: filter 0.5s ease;
        }
        
        .dark-subtle {
            opacity: 0.95;
        }
        
        /* 地震マーカーの基本スタイル */
        .earthquake-marker {
            border: 2px solid rgba(255, 255, 255, 0.8) !important;
            box-shadow: 0 0 8px rgba(255, 255, 255, 0.4) !important;
        }
        
        /* 津波予報区: 沿岸線に沿った太い色帯(TV 風表示) */
        .jma-tsunami-area {
            stroke-width: 5px !important;
            stroke-opacity: 1.0 !important;
            stroke-linecap: round !important;
            stroke-linejoin: round !important;
            fill-opacity: 0 !important; /* MultiLineString 前提。Polygon 誤投入時も塗らない */
        }
        /* 大津波警報・警報エリアの点滅アニメーション。
           stroke-opacity は !important 衝突のため触らず、要素全体の opacity と
           drop-shadow で脈動を表現する(@keyframes は !important を無視する仕様) */
        /* 全レベル共通の周期・タイミングで同期点滅させる。
           緊急度は不透明度の振れ幅とグロー強度で差別化する。 */
        .jma-tsunami-area.jma-major_warning {
            animation: tsunami-major-blink 1s ease-in-out infinite alternate;
        }
        .jma-tsunami-area.jma-warning {
            animation: tsunami-warning-blink 1s ease-in-out infinite alternate;
        }
        .jma-tsunami-area.jma-advisory {
            animation: tsunami-advisory-blink 1s ease-in-out infinite alternate;
        }
        @keyframes tsunami-major-blink {
            from { opacity: 0.25; filter: drop-shadow(0 0 1px currentColor); }
            to   { opacity: 1;    filter: drop-shadow(0 0 8px currentColor); }
        }
        @keyframes tsunami-warning-blink {
            from { opacity: 0.15; filter: drop-shadow(0 0 1px currentColor); }
            to   { opacity: 1;    filter: drop-shadow(0 0 5px currentColor); }
        }
        @keyframes tsunami-advisory-blink {
            from { opacity: 0.2;  filter: drop-shadow(0 0 0 transparent); }
            to   { opacity: 1;    filter: drop-shadow(0 0 3px currentColor); }
        }

        /* ===== TV風 津波警報テロップ(画面下部横スクロール) ===== */
        .tsunami-ticker {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 46px;
            display: none;               /* JS 側で flex に切替 */
            align-items: center;
            background: linear-gradient(90deg, #2a0000 0%, #4a0000 50%, #2a0000 100%);
            color: #fff;
            z-index: 9999;
            font-family: 'Inter', 'Noto Sans JP', sans-serif;
            font-weight: 700;
            overflow: hidden;
            box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.6);
            border-top: 3px solid #FFD700;
        }
        .tsunami-ticker.level-major_warning { border-top-color: #B14ABA; animation: ticker-pulse-border 1s ease-in-out infinite alternate; }
        .tsunami-ticker.level-warning       { border-top-color: #FF2800; animation: ticker-pulse-border 1s ease-in-out infinite alternate; }
        .tsunami-ticker.level-advisory      { border-top-color: #F2E700; }
        @keyframes ticker-pulse-border {
            from { box-shadow: 0 -6px 20px rgba(0,0,0,0.6), inset 0 3px 0 rgba(255,255,255,0.1); }
            to   { box-shadow: 0 -6px 28px currentColor,   inset 0 3px 0 rgba(255,255,255,0.4); }
        }
        .tsunami-ticker .ticker-label {
            flex-shrink: 0;
            height: 100%;
            padding: 0 18px;
            display: flex;
            align-items: center;
            gap: 8px;
            background: rgba(0, 0, 0, 0.55);
            font-size: 15px;
            letter-spacing: 0.08em;
            border-right: 2px solid rgba(255, 255, 255, 0.15);
            text-shadow: 0 0 6px currentColor;
        }
        .tsunami-ticker.level-major_warning .ticker-label { color: #ff9dff; }
        .tsunami-ticker.level-warning       .ticker-label { color: #ffa077; }
        .tsunami-ticker.level-advisory      .ticker-label { color: #fff08c; }
        .tsunami-ticker .ticker-time {
            flex-shrink: 0;
            padding: 0 14px;
            height: 100%;
            display: flex;
            align-items: center;
            font-size: 12px;
            color: #bbb;
            background: rgba(0, 0, 0, 0.35);
            border-right: 1px solid rgba(255, 255, 255, 0.1);
            letter-spacing: 0.04em;
        }
        .tsunami-ticker .ticker-track {
            flex: 1;
            height: 100%;
            overflow: hidden;
            position: relative;
        }
        .tsunami-ticker .ticker-content {
            position: absolute;
            left: 0;
            top: 50%;
            transform: translateY(-50%);
            white-space: nowrap;
            animation: ticker-scroll 45s linear infinite;
            padding-left: 100%;           /* 右端から流し始める */
            font-size: 14px;
            line-height: 1;
        }
        .tsunami-ticker .ticker-item {
            display: inline-block;
            padding: 0 22px;
        }
        .tsunami-ticker .ticker-item .tag {
            display: inline-block;
            padding: 3px 8px;
            border-radius: 3px;
            margin-right: 8px;
            font-size: 12px;
            letter-spacing: 0.05em;
        }
        .tsunami-ticker .ticker-item.level-major_warning .tag { background: #B14ABA; color: #fff; }
        .tsunami-ticker .ticker-item.level-warning       .tag { background: #FF2800; color: #fff; }
        .tsunami-ticker .ticker-item.level-advisory      .tag { background: #F2E700; color: #333; }
        .tsunami-ticker .ticker-item .area  { font-weight: 800; margin-right: 8px; }
        .tsunami-ticker .ticker-item .wave  { color: #ffd18c; margin-right: 8px; font-variant-numeric: tabular-nums; }
        .tsunami-ticker .ticker-item .eta   { color: #ccc; font-size: 13px; }
        .tsunami-ticker .ticker-item .sep   { color: rgba(255, 255, 255, 0.25); margin-left: 22px; }
        @keyframes ticker-scroll {
            from { transform: translate(0%, -50%); }
            to   { transform: translate(-100%, -50%); }
        }
        
        /* 日本都市マーカーの表示 */
        .japan-city-marker {
            transition: all 0.3s ease;
            cursor: pointer;
        }
        
        /* マーカーのホバー効果 */
        .japan-city-marker:hover {
            transform: scale(1.3);
            filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.6));
        }
        
        /* 都市ツールチップのスタイル */
        .japan-city-tooltip {
            background: rgba(255, 255, 255, 0.95) !important;
            color: #333333 !important;
            border: 1px solid #cccccc !important;
            border-radius: 4px !important;
            font-size: 12px !important;
            font-weight: 500 !important;
            padding: 4px 8px !important;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
        }
        
        /* レイヤーコントロールのスタイル改善 */
        .leaflet-control-layers-list {
            color: white !important;
        }
        
        .leaflet-control-layers-base label {
            color: white !important;
            font-weight: 500 !important;
        }
        
        .leaflet-control-layers-base input[type="radio"] {
            accent-color: #4a9eff !important;
        }
        /* === 設定パネルスタイル === */
        .setting-item {
            margin-bottom: 16px;
            padding: 12px;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 8px;
            border: 1px solid rgba(255, 255, 255, 0.1);
        }
        
        .setting-description {
            font-size: 13px;
            color: #a0aec0;
            margin-top: 4px;
            line-height: 1.4;
        }
        
        .test-tool-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
            transition: all 0.3s ease;
        }
        
        .quick-test-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
            transition: all 0.2s ease;
        }

        .setting-label {
            display: block;
            font-size: 14px;
            font-weight: 600;
            color: #74b9ff;
            margin-bottom: 8px;
        }

        .setting-input-group {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .setting-input-group input[type="range"] {
            flex: 1;
            height: 6px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 3px;
            outline: none;
            -webkit-appearance: none;
        }

        .setting-input-group input[type="range"]::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 18px;
            height: 18px;
            background: #74b9ff;
            border-radius: 50%;
            cursor: pointer;
        }

        .setting-input-group select {
            flex: 1;
            padding: 8px 12px;
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 6px;
            color: #ffffff;
            font-size: 14px;
        }

        .setting-input-group select option {
            background: #2d3748;
            color: #ffffff;
        }

        .setting-value {
            min-width: 60px;
            text-align: center;
            font-size: 14px;
            font-weight: 600;
            color: #74b9ff;
        }

        .toggle-switch {
            position: relative;
            display: inline-block;
            width: 50px;
            height: 24px;
        }

        .toggle-switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .toggle-slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: rgba(255, 255, 255, 0.2);
            transition: .4s;
            border-radius: 24px;
        }

        .toggle-slider:before {
            position: absolute;
            content: "";
            height: 18px;
            width: 18px;
            left: 3px;
            bottom: 3px;
            background-color: white;
            transition: .4s;
            border-radius: 50%;
        }

        input:checked + .toggle-slider {
            background-color: #74b9ff;
        }

        input:checked + .toggle-slider:before {
            transform: translateX(26px);
        }

        .test-button {
            padding: 8px 16px;
            background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
            color: white;
            border: none;
            border-radius: 6px;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            margin-right: 8px;
        }

        .test-button:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(116, 185, 255, 0.3);
        }

        /* === ホームボタンコントロール === */
        .home-control {
            transition: all 0.3s ease !important;
        }

        .home-control:hover {
            background-color: rgba(74, 158, 255, 1) !important;
            transform: scale(1.1) !important;
            box-shadow: 0 2px 8px rgba(74, 158, 255, 0.5) !important;
        }

        .home-control:active {
            transform: scale(0.95) !important;
        }
