/* ===== リセット & 変数 ===== */
:root {
  --bg-primary: #0a0f1e;
  --bg-secondary: #111827;
  --bg-card: #1a2035;
  --bg-card-hover: #1e2642;
  --bg-glass: rgba(26, 32, 53, 0.85);
  --border: rgba(99, 123, 180, 0.2);
  --border-active: rgba(99, 123, 180, 0.5);
  --text-primary: #e8eaf6;
  --text-secondary: #9aa3c0;
  --text-muted: #5a6380;
  --accent-blue: #4fc3f7;
  --accent-cyan: #00e5ff;
  --accent-green: #69f0ae;
  --accent-yellow: #ffeb3b;
  --accent-orange: #ff9800;
  --accent-red: #f44336;
  --accent-purple: #ce93d8;
  --accent-discord: #5865f2;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-card: 0 2px 12px rgba(0,0,0,0.3);
  --radius: 12px;
  --radius-sm: 8px;
  --header-h: 60px;
  --transition: 0.2s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans JP', 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
}

/* ===== ヘッダー ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(10, 15, 30, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1600px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 12px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.logo-icon { font-size: 24px; }

.logo-text {
  font-size: 20px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.logo-sub {
  font-size: 11px;
  color: var(--text-muted);
  display: none;
}

@media (min-width: 900px) { .logo-sub { display: block; } }

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pref-select {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition);
  font-family: inherit;
}

.pref-select:focus { border-color: var(--accent-blue); }

/* ===== ボタン ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  font-family: inherit;
}

.btn:hover { background: var(--bg-card-hover); border-color: var(--border-active); }

.btn-icon { padding: 7px 10px; }

.btn-notify {
  background: rgba(79, 195, 247, 0.1);
  border-color: rgba(79, 195, 247, 0.3);
  color: var(--accent-blue);
}

.btn-notify:hover { background: rgba(79, 195, 247, 0.2); }
.btn-notify.active { background: rgba(105, 240, 174, 0.1); border-color: var(--accent-green); color: var(--accent-green); }

.btn-discord {
  background: rgba(88, 101, 242, 0.15);
  border-color: rgba(88, 101, 242, 0.4);
  color: #7289da;
  width: 100%;
  justify-content: center;
  font-size: 14px;
  padding: 10px;
}

.btn-discord:hover { background: rgba(88, 101, 242, 0.25); }

/* ===== アラートバー ===== */
.alert-bar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  z-index: 90;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 14px;
  animation: slideDown 0.3s ease;
  transition: all var(--transition);
}

.alert-bar.warning { background: rgba(255, 152, 0, 0.9); color: #000; }
.alert-bar.danger { background: rgba(244, 67, 54, 0.95); color: #fff; }
.alert-bar.critical { background: #b71c1c; color: #fff; animation: pulse 1s infinite; }
.alert-bar.hidden { display: none; }

@keyframes slideDown { from { transform: translateY(-100%); } to { transform: translateY(0); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.7; } }

/* ===== メインレイアウト ===== */
.main {
  max-width: 1600px;
  margin: 0 auto;
  padding: 12px;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 280px;
  gap: 12px;
  min-height: calc(100vh - var(--header-h) - 40px);
}

@media (max-width: 1200px) {
  .main { grid-template-columns: 260px minmax(0, 1fr); }
  .right-panel { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  .main { grid-template-columns: minmax(0, 1fr); }
  .map-area { min-height: 52vh; }
}

/* ===== カード ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition);
}

.card:hover { border-color: var(--border-active); }

.card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.card-icon { font-size: 18px; }
.card-title { font-size: 14px; font-weight: 700; flex: 1; }
.card-date { font-size: 12px; color: var(--text-muted); }

.refresh-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all var(--transition);
}
.refresh-btn:hover { background: var(--border); transform: rotate(180deg); }

/* ===== 今日の情報 ===== */
.today-holiday {
  background: rgba(255, 235, 59, 0.1);
  border: 1px solid rgba(255, 235, 59, 0.3);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 13px;
  color: var(--accent-yellow);
  margin-bottom: 8px;
  font-weight: 600;
}

.today-special {
  font-size: 12px;
  color: var(--accent-cyan);
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
  line-height: 1.5;
}

.today-trivia {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
  padding: 4px 0;
}

.today-trivia-cat {
  display: inline-block;
  background: rgba(79, 195, 247, 0.1);
  color: var(--accent-blue);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  margin-bottom: 4px;
  font-weight: 700;
}

/* ===== 天気カード ===== */
.weather-main {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.weather-icon-big { font-size: 48px; line-height: 1; }

.temp-main {
  font-size: 36px;
  font-weight: 900;
  color: var(--accent-cyan);
  line-height: 1;
  display: block;
}

.temp-feels { font-size: 12px; color: var(--text-muted); }

.weather-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  text-align: center;
}

.weather-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 8px;
}

.weather-detail-item {
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.weather-suntime {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

/* ===== 予報リスト ===== */
.forecast-list { display: flex; flex-direction: column; gap: 6px; }

.forecast-item {
  display: grid;
  grid-template-columns: 50px 32px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.forecast-date { color: var(--text-secondary); font-weight: 600; }
.forecast-icon { font-size: 20px; text-align: center; }
.forecast-desc { color: var(--text-secondary); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.forecast-temp { color: var(--accent-cyan); font-weight: 700; white-space: nowrap; }

/* ===== 警報リスト ===== */
.warning-list { display: flex; flex-direction: column; gap: 4px; }

.warning-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
}

.warning-item.alert { background: rgba(244,67,54,0.15); border: 1px solid rgba(244,67,54,0.3); color: #ef9a9a; }
.warning-item.warning { background: rgba(255,152,0,0.12); border: 1px solid rgba(255,152,0,0.3); color: #ffcc80; }
.warning-item.advisory { background: rgba(255,235,59,0.1); border: 1px solid rgba(255,235,59,0.3); color: var(--accent-yellow); }

/* ===== ステータスバッジ ===== */
.status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}

.status-badge.ok { background: rgba(105,240,174,0.1); color: var(--accent-green); border: 1px solid rgba(105,240,174,0.3); }
.status-badge.warning { background: rgba(255,152,0,0.15); color: var(--accent-orange); border: 1px solid rgba(255,152,0,0.4); }
.status-badge.danger { background: rgba(244,67,54,0.15); color: #ef5350; border: 1px solid rgba(244,67,54,0.4); }

/* ===== 地震リスト ===== */
.quake-list { display: flex; flex-direction: column; gap: 6px; }

.quake-item {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border-left: 3px solid;
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  transition: background var(--transition);
}

.quake-item:hover { background: rgba(255,255,255,0.07); }

.quake-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
}

.quake-name { font-size: 13px; font-weight: 700; }
.quake-mag { font-size: 12px; font-weight: 700; color: var(--accent-orange); }
.quake-scale-badge {
  font-size: 11px;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.1);
}

.quake-info { font-size: 11px; color: var(--text-muted); }
.quake-tsunami { font-size: 11px; font-weight: 700; color: #4fc3f7; margin-top: 2px; }

/* 震度カラー */
.quake-item[data-scale="low"] { border-color: #87ceeb; }
.quake-item[data-scale="mid"] { border-color: #ffd700; }
.quake-item[data-scale="high"] { border-color: #ff4500; }
.quake-item[data-scale="critical"] { border-color: #8b0000; }

/* ===== 河川リスト ===== */
.river-list { display: flex; flex-direction: column; gap: 4px; }
.no-data { font-size: 12px; color: var(--text-muted); text-align: center; padding: 12px; }

.river-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03);
  font-size: 12px;
}

.river-name { font-weight: 600; }
.river-status-0 { color: var(--accent-green); }
.river-status-1 { color: var(--accent-yellow); }
.river-status-2 { color: var(--accent-orange); }
.river-status-3 { color: var(--accent-red); }
.river-status-4 { color: #ff1744; font-weight: 900; }

/* ===== Discord カード ===== */
.discord-info { display: flex; flex-direction: column; gap: 10px; }
.discord-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.6; }

.discord-commands { display: flex; flex-direction: column; gap: 4px; }
.cmd-item { font-size: 12px; color: var(--text-secondary); display: flex; gap: 8px; }
.cmd-item code {
  background: rgba(79,195,247,0.1);
  color: var(--accent-blue);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  white-space: nowrap;
}

/* ===== マップエリア ===== */
.map-area {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 500px;
}

.map-wrap {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  flex: 1;
  min-height: 440px;
}

.map-container {
  width: 100%;
  height: 100%;
  min-height: 440px;
  background: #0d1117;
}

/* ===== レーダーバー ===== */
.radar-bar {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 10;
  background: rgba(10, 15, 30, 0.9);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  backdrop-filter: blur(8px);
}

.radar-bar.hidden { display: none; }

.radar-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  padding: 2px 4px;
}

.radar-time { font-size: 12px; font-weight: 700; color: var(--accent-cyan); white-space: nowrap; }
.radar-slider { width: 110px; accent-color: var(--accent-blue); cursor: pointer; }

/* ===== 震度凡例 ===== */
.map-legend {
  position: absolute;
  left: 10px;
  bottom: 52px;
  z-index: 10;
  background: rgba(10, 15, 30, 0.88);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 11px;
  color: var(--text-secondary);
  backdrop-filter: blur(6px);
}

.legend-title { font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.legend-row { display: flex; align-items: center; gap: 6px; line-height: 1.7; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* ===== 詳細・グラフプレビュー ===== */
.preview-card { margin-bottom: 0; }

.quake-detail { margin-bottom: 12px; }

.quake-detail-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.quake-detail-name { font-size: 16px; font-weight: 900; color: var(--accent-cyan); }
.quake-detail-scale { font-size: 13px; font-weight: 700; }

.quake-detail-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}

.quake-stat {
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-sm);
  padding: 6px 9px;
  font-size: 11px;
  color: var(--text-muted);
}

.quake-stat strong { display: block; font-size: 13px; color: var(--text-primary); }

.point-chips { display: flex; flex-wrap: wrap; gap: 4px; }

.point-chip {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border-left: 3px solid var(--accent-blue);
  color: var(--text-secondary);
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.chart-box {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.chart-title { font-size: 12px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; }
.chart-body { min-height: 150px; display: flex; align-items: center; justify-content: center; }
.chart-body svg { width: 100%; height: auto; }
.chart-empty { font-size: 12px; color: var(--text-muted); }

.map-controls {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 10;
  background: rgba(10, 15, 30, 0.9);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 6px 10px;
  backdrop-filter: blur(8px);
}

.map-ctrl-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 16px;
  transition: all var(--transition);
  font-family: inherit;
}

.map-ctrl-btn:hover { color: var(--text-primary); background: var(--border); }
.map-ctrl-btn.active { background: rgba(79,195,247,0.2); color: var(--accent-blue); }

.map-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  z-index: 20;
}

/* ===== スピナー ===== */
.loading-spinner {
  display: flex;
  justify-content: center;
  padding: 20px;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== モーダル ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal.hidden { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  border-radius: var(--radius);
  padding: 20px;
  max-width: 480px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  z-index: 1;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.modal-close:hover { background: var(--border); color: var(--text-primary); }

/* ===== フッター ===== */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 10px 16px;
}

.footer-inner {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

/* ===== ユーティリティ ===== */
.hidden { display: none !important; }

/* ===== Leaflet カスタム ===== */
.leaflet-container { background: #0d1117; }
.leaflet-tile-pane { filter: brightness(0.7) saturate(0.5); }
.leaflet-popup-content-wrapper {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.leaflet-popup-tip { background: var(--bg-card); }
.leaflet-popup-content { margin: 10px 14px; font-size: 13px; font-family: 'Noto Sans JP', sans-serif; }

.quake-popup-title { font-weight: 700; font-size: 14px; color: var(--accent-cyan); margin-bottom: 4px; }
.quake-popup-detail { font-size: 12px; color: var(--text-secondary); line-height: 1.8; }

/* ===== スクロールバー ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-active); }

/* ===== レスポンシブ ===== */
@media (max-width: 480px) {
  .header-inner { padding: 0 10px; }
  .logo-text { font-size: 16px; }
  .pref-select { font-size: 12px; padding: 5px 8px; }
}

/* ===== SVGアイコン ===== */
.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -3px;
  flex-shrink: 0;
}

.icon-logo { width: 26px; height: 26px; color: var(--accent-blue); }
.icon-sm { width: 14px; height: 14px; vertical-align: -2px; }
.card-icon { display: inline-flex; color: var(--accent-blue); }
.card-icon .icon { width: 19px; height: 19px; }
.logo-icon { display: inline-flex; font-size: inherit; }
#notify-icon { display: inline-flex; }

/* ===== フッターリンク ===== */
.footer-links { display: inline-flex; gap: 12px; }
.footer-links a { color: var(--text-secondary); text-decoration: none; }
.footer-links a:hover { color: var(--accent-blue); text-decoration: underline; }

/* ===== 新UI（body.new-ui のときだけ適用。切替はヘッダーのボタン） ===== */
body.new-ui {
  --bg-primary: #070b18;
  --bg-secondary: #0d1326;
  --bg-card: rgba(23, 32, 58, 0.72);
  --bg-card-hover: rgba(32, 43, 74, 0.85);
  --border: rgba(125, 211, 252, 0.16);
  --border-active: rgba(125, 211, 252, 0.45);
  --accent-blue: #7dd3fc;
  --accent-cyan: #22d3ee;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  --shadow-card: 0 8px 28px rgba(0, 0, 0, 0.35);
  background:
    radial-gradient(900px 480px at 85% -5%, rgba(34, 211, 238, 0.14), transparent 60%),
    radial-gradient(800px 500px at -10% 20%, rgba(167, 139, 250, 0.12), transparent 60%),
    var(--bg-primary);
  background-attachment: fixed;
}

body.new-ui .header {
  background: linear-gradient(90deg, rgba(14, 20, 40, 0.92), rgba(19, 28, 56, 0.88));
  border-bottom: 1px solid rgba(125, 211, 252, 0.25);
}

body.new-ui .logo-text {
  background: linear-gradient(120deg, #7dd3fc, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
}

body.new-ui .card {
  backdrop-filter: blur(14px);
  border-radius: var(--radius);
}

body.new-ui .btn,
body.new-ui .pref-select { border-radius: 999px; }

body.new-ui .map-wrap {
  border-radius: 22px;
  box-shadow: var(--shadow);
  border-color: rgba(125, 211, 252, 0.28);
}

body.new-ui .map-controls { border-radius: 999px; padding: 7px 12px; }
body.new-ui .map-ctrl-btn { border-radius: 999px; padding: 6px 12px; }
body.new-ui .map-ctrl-btn.active { background: linear-gradient(120deg, rgba(125, 211, 252, 0.35), rgba(167, 139, 250, 0.35)); color: #e0f2fe; }

body.new-ui .chart-box { border-radius: 14px; background: rgba(255, 255, 255, 0.035); }
body.new-ui .quake-item { border-radius: 12px; }
body.new-ui .status-badge { padding: 3px 10px; }

body.new-ui .footer { background: rgba(13, 19, 38, 0.85); backdrop-filter: blur(10px); }

.ui-toggle { gap: 5px; }
.ui-toggle .icon { color: var(--accent-purple, #ce93d8); }

/* ===== 新UIバッジ（新UIのときだけ表示） ===== */
.new-ui-badge {
  display: none;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #0b1020;
  background: linear-gradient(120deg, #7dd3fc, #a78bfa);
  border-radius: 999px;
  padding: 2px 9px;
  margin-left: 8px;
  vertical-align: 3px;
}
body.new-ui .new-ui-badge { display: inline-block; }

/* ===== 新UIの差を大きく（レイアウト・色・形をはっきり変える） ===== */
body.new-ui .header-inner { padding-top: 6px; padding-bottom: 6px; }
body.new-ui .logo-text { font-size: 24px; letter-spacing: 0.02em; }
body.new-ui .logo-icon .icon-logo { width: 32px; height: 32px; color: #a78bfa; }

body.new-ui .main {
  grid-template-columns: 300px minmax(0, 1.5fr) 300px;
  gap: 18px;
  padding-top: 20px;
}

body.new-ui .card {
  border-top: 3px solid rgba(125, 211, 252, 0.55);
  box-shadow: 0 10px 32px rgba(2, 6, 18, 0.55);
}
body.new-ui .card-title { font-size: 15px; letter-spacing: 0.04em; }
body.new-ui .card-icon .icon { width: 21px; height: 21px; color: #a78bfa; }

body.new-ui .map-wrap { min-height: 460px; }
body.new-ui .map-container { min-height: 460px; }

body.new-ui .status-badge {
  background: linear-gradient(120deg, rgba(125, 211, 252, 0.25), rgba(167, 139, 250, 0.25));
  border: 1px solid rgba(125, 211, 252, 0.4);
  border-radius: 999px;
}

body.new-ui .quake-item {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(125, 211, 252, 0.12);
  margin-bottom: 8px;
  padding: 10px 12px;
}
body.new-ui .quake-item:hover { border-color: rgba(167, 139, 250, 0.55); transform: translateX(2px); }

body.new-ui .btn-notify.active,
body.new-ui .btn-notify { box-shadow: 0 4px 16px rgba(34, 211, 238, 0.25); }

body.new-ui .preview-card { border-top-color: rgba(167, 139, 250, 0.65); }
body.new-ui .chart-title { color: #c4b5fd; }

body.new-ui .footer { border-top: 1px solid rgba(167, 139, 250, 0.3); }

@media (max-width: 1200px) {
  body.new-ui .main { grid-template-columns: 260px minmax(0, 1fr) 260px; }
}
@media (max-width: 900px) {
  body.new-ui .main { grid-template-columns: 1fr; }
  body.new-ui .map-wrap, body.new-ui .map-container { min-height: 60vh; }
}

/* ===== 地図がUIからはみ出さないための固定 ===== */
.main > * { min-width: 0; }
.map-area { min-width: 0; max-width: 100%; }
.map-wrap { width: 100%; max-width: 100%; }
.zones-preview { max-width: 340px; margin: 0 auto 2px; }

/* ===== 警報の見出し（短く） ===== */
.warning-headline { font-size: 11px; color: var(--text-muted); line-height: 1.5; padding: 4px 2px 0; }

/* ===== 設定モーダル ===== */
.settings-grid { display: flex; flex-direction: column; gap: 4px; }
.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 2px; border-bottom: 1px solid var(--border);
}
.setting-row:last-child { border-bottom: none; }
.setting-label { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.setting-desc { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.setting-control select {
  background: var(--bg-secondary); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; font-size: 13px;
}
.setting-control input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent-blue); cursor: pointer; }
.settings-note { font-size: 11px; color: var(--text-muted); margin-top: 10px; line-height: 1.6; }
.modal-body { padding: 22px; overflow-y: auto; }

/* ===== 重なり順の固定: 地図(Leaflet)を自分の枠内に閉じ込める ===== */
.map-wrap { z-index: 0; }
.alert-bar { z-index: 1500; }

/* ===== スマホ対応（パネルを隠さず、縦積み＋順序最適化） ===== */
html, body { overflow-x: clip; }
img, svg, canvas { max-width: 100%; }

@media (max-width: 860px) {
  .main { gap: 10px; padding: 10px; }
  /* スマホでは 地図 → 地震情報 → 天気・警報 の順に見せる */
  .map-area { order: 1; }
  .right-panel { order: 2; }
  #side-panel { order: 3; }
  .map-wrap, .map-container { min-height: 46vh; }
  body.new-ui .map-wrap, body.new-ui .map-container { min-height: 46vh; }

  .header { height: auto; }
  .header-inner { flex-wrap: wrap; height: auto; padding-top: 8px; padding-bottom: 8px; row-gap: 8px; }
  .header-controls { flex-wrap: wrap; row-gap: 6px; }
  .pref-select { flex: 1 1 140px; min-height: 40px; }
  .btn { min-height: 40px; }
  .map-ctrl-btn { min-height: 36px; padding: 7px 10px; font-size: 12px; }
  .map-controls { max-width: calc(100vw - 24px); flex-wrap: wrap; justify-content: center; }

  .map-legend { bottom: 46px; padding: 6px 8px; font-size: 10px; }
  .radar-bar { max-width: calc(100vw - 24px); }
  .radar-slider { width: 84px; }

  .card { padding: 12px; }
  .quake-detail-stats { grid-template-columns: repeat(2, 1fr); }
  .zones-preview { max-width: 300px; }

  .modal { padding: 10px; align-items: flex-end; }
  .modal-content { max-height: 92dvh; border-radius: 16px; }
  .setting-row { flex-direction: column; align-items: stretch; gap: 6px; }
  .setting-control select { width: 100%; min-height: 42px; }
  .setting-control input[type="checkbox"] { width: 22px; height: 22px; }

  .footer-inner { justify-content: center; text-align: center; }
}

@media (max-width: 480px) {
  .logo-sub { display: none; }
  #ui-toggle-text { display: none; }
  .logo-text { font-size: 17px; }
  body.new-ui .logo-text { font-size: 19px; }
  #notify-text { font-size: 12px; }
  .temp-main { font-size: 34px; }
  .quake-detail-stats { grid-template-columns: repeat(2, 1fr); }
  .point-chip { font-size: 10.5px; }
}

/* ===== 地図上のバー類をLeaflet(最大1000)より上へ（モーダル2000よりは下） ===== */
.map-controls, .radar-bar, .map-legend { z-index: 1100; }
.map-loading { z-index: 1200; }
