html,
body {
  margin: 0;
  padding: 0;
  background: #eef3f7;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #15202b;
}

.jmaeq_dashboard {
  max-width: 1500px;
  margin: 0 auto;
  background: #f5f8fb;
  min-height: 100vh;
}

.jmaeq_loading {
  padding: 24px;
  font-weight: 700;
}

.jmaeq_header {
  background: linear-gradient(90deg, #082846, #103b63);
  color: #fff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.jmaeq_header_left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.jmaeq_title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: .03em;
}

.jmaeq_header_divider {
  width: 1px;
  height: 28px;
  background: rgba(255,255,255,.35);
}

.jmaeq_subtitle {
  font-size: 14px;
  opacity: .9;
}

.jmaeq_update {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.jmaeq_auto {
  margin-left: 16px;
  opacity: .9;
}

.jmaeq_alert {
  display: none;
  background: #c40000;
  color: #fff;
  padding: 14px 24px;
  font-weight: 800;
  font-size: 17px;
}

.jmaeq_alert.jmaeq_show {
  display: block;
}

.jmaeq_tabs {
  display: flex;
  background: #e4edf5;
  border-bottom: 1px solid #c9d7e4;
}

.jmaeq_tab {
  border: none;
  background: transparent;
  padding: 14px 26px;
  font-weight: 800;
  color: #21364a;
  cursor: pointer;
  border-right: 1px solid #d2dde7;
}

.jmaeq_tab.jmaeq_active {
  background: #fff;
  border-bottom: 4px solid #0d6efd;
  color: #0b2b4a;
}

.jmaeq_panel {
  display: none;
  padding: 18px;
}

.jmaeq_panel.jmaeq_panel_active {
  display: block;
}

/* ===== Earthquake layout ===== */

.jmaeq_quake_grid {
  display: grid;
  grid-template-columns: 560px 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

.jmaeq_summary_card,
.jmaeq_map_card,
.jmaeq_detail_card,
.jmaeq_nearby_card,
.jmaeq_history_card {
  background: #fff;
  border: 1px solid #d7e0e8;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}

.jmaeq_summary_top {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 20px;
  padding: 18px;
  border-bottom: 1px solid #e4ebf1;
}

.jmaeq_max_box {
  color: #fff;
  border-radius: 7px;
  text-align: center;
  padding: 14px 8px;
}

.jmaeq_max_label {
  font-size: 17px;
  font-weight: 800;
}

.jmaeq_max_value {
  font-size: 54px;
  line-height: 1.05;
  font-weight: 900;
}

.jmaeq_summary_type {
  font-size: 15px;
  font-weight: 700;
  color: #455a70;
  margin-bottom: 8px;
}

.jmaeq_summary_title {
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 8px;
  line-height: 1.3;
}

.jmaeq_summary_time {
  font-size: 17px;
  color: #34495e;
}

.jmaeq_info_table {
  padding: 16px;
}

.jmaeq_info_row {
  display: grid;
  grid-template-columns: 150px 1fr;
  border: 1px solid #dfe7ef;
  border-bottom: none;
}

.jmaeq_info_row:last-child {
  border-bottom: 1px solid #dfe7ef;
}

.jmaeq_info_label {
  background: #f3f7fb;
  padding: 13px 14px;
  font-weight: 800;
  color: #34495e;
  border-right: 1px solid #dfe7ef;
}

.jmaeq_info_value {
  padding: 13px 14px;
  font-weight: 700;
}

.jmaeq_map_card {
  position: relative;
  padding: 0;
  overflow: hidden;
}

.jmaeq_map_header {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 500;
  background: #1b3654;
  color: #fff;
  font-weight: 900;
  padding: 12px 24px;
  border-bottom-right-radius: 4px;
}

.jmaeq_main_map {
  height: 496px;
  min-height: 496px;
}

.jmaeq_nearby_map {
  height: 340px;
  border-radius: 8px;
  overflow: hidden;
}

.jmaeq_history_map {
  height: 420px;
  border-radius: 8px;
  overflow: hidden;
  background: #dfe7ef;
  margin-top: 10px;
  box-shadow: inset 0 0 0 1px #d7e0e8;
}

/* ===== Legend ===== */

.jmaeq_legend {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 600;
  background: rgba(255,255,255,.94);
  border-radius: 8px;
  padding: 14px 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,.15);
}

.jmaeq_legend_title {
  font-weight: 900;
  margin-bottom: 8px;
}

.jmaeq_legend_row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 5px 0;
  font-size: 13px;
}

.jmaeq_legend_badge,
.jmaeq_int_badge {
  min-width: 34px;
  text-align: center;
  border-radius: 4px;
  padding: 4px 6px;
  font-weight: 900;
  color: #fff;
}

/* ===== Intensity colors ===== */

.jmaeq_int_7 {
  background: #7b1b8f;
  color: #fff;
}

.jmaeq_int_6p {
  background: #b40000;
  color: #fff;
}

.jmaeq_int_6m {
  background: #d33220;
  color: #fff;
}

.jmaeq_int_5p {
  background: #f36c21;
  color: #fff;
}

.jmaeq_int_5m {
  background: #f7941d;
  color: #fff;
}

.jmaeq_int_4 {
  background: #f9d94a;
  color: #111;
}

.jmaeq_int_3 {
  background: #256fe6;
  color: #fff;
}

.jmaeq_int_2 {
  background: #58aee8;
  color: #fff;
}

.jmaeq_int_1 {
  background: #fff;
  color: #222;
  border: 1px solid #b7c6d5;
}

.jmaeq_int_unknown {
  background: #8796a4;
  color: #fff;
}

/* ===== Map markers ===== */

.jmaeq_cross_marker {
  font-weight: 900;
  font-family: Arial, sans-serif;
}

.jmaeq_area_map_marker {
  min-width: 30px;
  height: 26px;
  padding: 2px 5px;
  border-radius: 5px;
  border: 2px solid rgba(255,255,255,.95);
  box-shadow: 0 2px 8px rgba(0,0,0,.28);
  font-size: 15px;
  line-height: 22px;
  font-weight: 900;
  text-align: center;
  box-sizing: border-box;
}

.jmaeq_area_map_marker.jmaeq_int_1 {
  background: #fff;
  color: #222;
  border: 2px solid #9fb0c0;
}

.jmaeq_area_map_marker.jmaeq_int_4 {
  color: #111;
}

.jmaeq_selected_map_info {
  background: rgba(255,255,255,.95);
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,.18);
  font-size: 13px;
  line-height: 1.7;
  color: #172f49;
  min-width: 170px;
}

.jmaeq_selected_map_title {
  font-weight: 900;
  font-size: 14px;
  border-bottom: 1px solid #d7e0e8;
  padding-bottom: 4px;
  margin-bottom: 6px;
}

/* ===== Detail section ===== */

.jmaeq_lower_grid {
  display: grid;
  grid-template-columns: 1.4fr .95fr;
  gap: 18px;
}

.jmaeq_detail_card,
.jmaeq_nearby_card,
.jmaeq_history_card {
  padding: 18px;
}

.jmaeq_block_title {
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 12px;
  color: #172f49;
}

.jmaeq_detail_text {
  font-size: 15px;
  line-height: 1.8;
  margin-bottom: 16px;
}

.jmaeq_area_grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.jmaeq_area_item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #f7fafc;
  border: 1px solid #dfe7ef;
  border-radius: 7px;
  padding: 10px 12px;
  font-size: 14px;
}

.jmaeq_area_item.jmaeq_akita_area {
  border-color: #b40000;
  background: #fff2f2;
}

.jmaeq_area_name {
  font-weight: 700;
}

/* ===== Long period inline ===== */

.jmaeq_longperiod_inline {
  margin: 16px 0;
  border-left: 6px solid #6f1d8f;
  background: #f7f0fb;
  border-radius: 7px;
  padding: 12px 14px;
}

.jmaeq_longperiod_inline_title {
  font-weight: 900;
  color: #4d1165;
  margin-bottom: 6px;
}

.jmaeq_longperiod_inline_text {
  font-size: 14px;
  line-height: 1.7;
}

.jmaeq_lp_pill {
  background: #f0e3f8;
  color: #4d1165;
}

/* ===== History ===== */

.jmaeq_history_card {
  margin-top: 18px;
}

.jmaeq_history_list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.jmaeq_history_item {
  background: #f8fbfd;
  border-left: 5px solid #8aa0b4;
  border-radius: 7px;
  padding: 12px;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}

.jmaeq_history_item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,.12);
  background: #ffffff;
}

.jmaeq_history_item.jmaeq_history_high {
  border-left-color: #d93025;
}

.jmaeq_history_item.jmaeq_history_selected {
  outline: 3px solid #0d6efd;
  background: #eef6ff;
}

.jmaeq_history_item:focus {
  outline: 3px solid #0d6efd;
  outline-offset: 2px;
}

.jmaeq_history_place {
  font-size: 17px;
  font-weight: 900;
}

.jmaeq_history_meta {
  font-size: 13px;
  color: #50677c;
  margin-top: 4px;
}

.jmaeq_history_badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.jmaeq_pill {
  background: #eef4fa;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

/* ===== Volcano ===== */

.jmaeq_volcano_dashboard {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 18px;
}

.jmaeq_volcano_main_card {
  background: #fff;
  border: 1px solid #d7e0e8;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
  overflow: hidden;
}

.jmaeq_volcano_status {
  background: #b40000;
  color: #fff;
  padding: 14px 18px;
  font-size: 20px;
  font-weight: 900;
}

.jmaeq_volcano_body {
  padding: 18px;
}

.jmaeq_volcano_name {
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 8px;
  color: #172f49;
}

.jmaeq_volcano_time {
  font-size: 14px;
  color: #607286;
  margin-bottom: 14px;
}

.jmaeq_volcano_badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.jmaeq_volcano_badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  background: #eef4fa;
  color: #25384c;
}

.jmaeq_volcano_badge_alert {
  background: #b40000;
  color: #fff;
}

.jmaeq_volcano_badge_level {
  background: #f36c21;
  color: #fff;
}

.jmaeq_volcano_text {
  line-height: 1.85;
  font-size: 15px;
  color: #1f2d3d;
  background: #fafcff;
  border: 1px solid #e1e8f0;
  padding: 14px;
  border-radius: 7px;
}

.jmaeq_volcano_note {
  margin-top: 14px;
  font-size: 13px;
  color: #607286;
  background: #f8fbfd;
  border: 1px solid #dfe7ef;
  border-radius: 7px;
  padding: 12px;
}

.jmaeq_volcano_link {
  margin-top: 14px;
  text-align: right;
}

.jmaeq_volcano_link a {
  display: inline-block;
  text-decoration: none;
  font-weight: 900;
  color: #0d3b66;
  background: #eef6ff;
  border: 1px solid #c8dbef;
  padding: 8px 12px;
  border-radius: 6px;
}

.jmaeq_volcano_map_card {
  background: #fff;
  border: 1px solid #d7e0e8;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
  padding: 16px;
}

.jmaeq_volcano_map_title {
  font-size: 20px;
  font-weight: 900;
  color: #172f49;
  margin-bottom: 12px;
}

.jmaeq_volcano_map {
  height: 430px;
  border-radius: 8px;
  overflow: hidden;
  background: #dfe7ef;
}

.jmaeq_volcano_marker {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e67e22;
  color: #fff;
  border: 3px solid #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  font-weight: 900;
}

.jmaeq_volcano_marker_alert {
  background: #b40000;
}

.jmaeq_volcano_list {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.jmaeq_volcano_sub_card {
  background: #fff;
  border: 1px solid #d7e0e8;
  border-left: 6px solid #e67e22;
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}

.jmaeq_volcano_sub_card.jmaeq_akita {
  border-left-color: #b40000;
  background: #fff6f6;
}

.jmaeq_volcano_sub_title {
  font-size: 18px;
  font-weight: 900;
  margin-bottom: 4px;
}

.jmaeq_volcano_sub_time {
  font-size: 13px;
  color: #607286;
  margin-bottom: 8px;
}

.jmaeq_volcano_sub_text {
  font-size: 14px;
  line-height: 1.7;
}

/* ===== Common ===== */

.jmaeq_empty,
.jmaeq_error {
  background: #fff;
  border-radius: 8px;
  padding: 18px;
  border: 1px solid #d9e2eb;
}

.jmaeq_error {
  color: #b40000;
  background: #fff2f2;
  font-weight: 800;
}
/* ===== 震源・震度マップ：タイトルを中央表示 ===== */
.jmaeq_map_header {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 650;
  background: rgba(23, 50, 77, 0.96);
  color: #fff;
  font-weight: 900;
  padding: 10px 28px;
  border-radius: 8px;
  border-bottom-right-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,.22);
  pointer-events: none;
  white-space: nowrap;
}

/* Leafletズームボタンとタイトルが干渉しないようにする */
.jmaeq_main_map .leaflet-top.leaflet-left {
  top: 12px;
  left: 12px;
}

/* ===== 震度凡例を右上に整理 ===== */
.jmaeq_legend {
  position: absolute;
  top: 70px;
  right: 18px;
  z-index: 620;
  background: rgba(255,255,255,.96);
  border-radius: 8px;
  padding: 14px 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,.18);
}

/* ===== 選択中の地震カード：左下に配置 ===== */
.jmaeq_selected_map_info {
  background: rgba(255,255,255,.97);
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,.22);
  font-size: 13px;
  line-height: 1.7;
  color: #172f49;
  min-width: 190px;
  max-width: 240px;
  border-left: 6px solid #0d6efd;
}

.jmaeq_selected_map_title {
  font-weight: 900;
  font-size: 14px;
  border-bottom: 1px solid #d7e0e8;
  padding-bottom: 4px;
  margin-bottom: 6px;
}

/* Leafletコントロール内の余白調整 */
.leaflet-control .jmaeq_selected_map_info {
  margin: 0;
}
/* ===== 地図内コントロールの最小化対応 ===== */

.jmaeq_map_control_toggle {
  appearance: none;
  border: none;
  background: #17324d;
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  line-height: 1;
  padding: 9px 12px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  white-space: nowrap;
}

.jmaeq_map_control_toggle:hover {
  background: #0d6efd;
}

/* 凡例：右上配置 */
.jmaeq_legend {
  position: absolute;
  top: 70px;
  right: 18px;
  z-index: 620;
  background: rgba(255,255,255,.96);
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,.18);
}

/* 凡例の中身 */
.jmaeq_legend_body {
  margin-top: 10px;
}

/* 凡例が折りたたみ状態のとき */
.jmaeq_legend.jmaeq_collapsed {
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.jmaeq_legend.jmaeq_collapsed .jmaeq_legend_body {
  display: none;
}

/* 選択中地震カードの外枠 */
.jmaeq_selected_map_wrapper {
  background: rgba(255,255,255,.97);
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,.22);
}

/* 選択中地震カード本体 */
.jmaeq_selected_map_info {
  margin-top: 10px;
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  font-size: 13px;
  line-height: 1.7;
  color: #172f49;
  min-width: 190px;
  max-width: 250px;
  border-left: 6px solid #0d6efd;
  padding-left: 10px;
}

/* 選択中地震カードが折りたたみ状態のとき */
.jmaeq_selected_map_wrapper.jmaeq_collapsed {
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.jmaeq_selected_map_wrapper.jmaeq_collapsed .jmaeq_selected_map_info {
  display: none;
}

.jmaeq_selected_map_title {
  font-weight: 900;
  font-size: 14px;
  border-bottom: 1px solid #d7e0e8;
  padding-bottom: 4px;
  margin-bottom: 6px;
}

/* Leafletコントロール内の余白調整 */
.leaflet-control .jmaeq_selected_map_wrapper {
  margin: 0;
}

/* スマホ向け */
@media (max-width: 700px) {
  .jmaeq_map_control_toggle {
    font-size: 12px;
    padding: 8px 10px;
  }

  .jmaeq_legend {
    top: 60px;
    right: 10px;
  }

  .jmaeq_selected_map_info {
    font-size: 12px;
    min-width: 160px;
    max-width: 220px;
  }
}

/* スマホでは凡例と選択カードを小さく */
@media (max-width: 700px) {
  .jmaeq_map_header {
    font-size: 14px;
    padding: 8px 16px;
  }

  .jmaeq_legend {
    top: 58px;
    right: 10px;
    padding: 10px 12px;
    font-size: 12px;
  }

  .jmaeq_selected_map_info {
    font-size: 12px;
    min-width: 160px;
    max-width: 210px;
  }
}

@media (max-width: 1100px) {
  .jmaeq_quake_grid,
  .jmaeq_lower_grid,
  .jmaeq_volcano_dashboard {
    grid-template-columns: 1fr;
  }

  .jmaeq_area_grid,
  .jmaeq_history_list {
    grid-template-columns: 1fr;
  }

  .jmaeq_header {
    flex-direction: column;
    align-items: flex-start;
  }

  .jmaeq_main_map {
    height: 420px;
  }

  .jmaeq_volcano_map {
    height: 360px;
  }
}