/* ショートコード表示部分の背景を白に固定 */
.weather-ai-wrapper {
    background: #ffffff !important;
    padding: 20px;
    border-radius: 12px;
}

.weather-icon {
  font-size: 2.6rem;
  color: cornflowerblue;
  display: block;
  margin: 0 auto 4px;
  line-height: 1;
}

#weatherTable td,
#weatherTable th {
  text-align: center;
  vertical-align: middle;
}

#weatherTable td div {
  text-align: center;
  font-size: 13px;
  line-height: 1.2;
}

/* ▼ 1列目（ラベル列）の改行＆中央寄せ */
#weatherTable td:first-child,
#weatherTable th:first-child {
  white-space: normal !important;
  text-align: center !important;
  line-height: 1.2;
  font-weight: bold;
  padding: 6px 2px;
}

canvas {
  max-width: 100%;
  margin-bottom: 30px;
}

#aiComment {
  background: #f5f5f5;
  padding: 12px;
  font-size: 15px;
}

/* =========================
  ✅ 7日間天気テーブル 共通
========================= */
#weatherTable {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin-bottom: 32px;
}

h3 + canvas {
  margin-top: 16px;
}

/* =========================
  見出し＋ボタン
========================= */
.weather-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.weather-graph-btn {
  background: #2c7be5;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}

.weather-graph-btn:active {
  opacity: 0.8;
}

/* =========================
  モーダル本体
========================= */
.weather-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.6);
}

.weather-modal-content {
  background: #fff;
  width: 92%;
  max-width: 900px;
  height: 90vh;
  margin: 5vh auto;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
}

/* =========================
  固定ヘッダー
========================= */
.weather-modal-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #fff;
  border-bottom: 1px solid #ddd;
  min-height: 48px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.weather-modal-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-weight: bold;
  font-size: 16px;
}

.weather-modal-close {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  font-weight: bold;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
  background: #f2f2f2;
}

/* =========================
  中身スクロール
========================= */
.weather-modal-body {
  overflow-y: auto;
  padding: 12px;
  flex: 1;
}

.weather-modal-body canvas {
  margin-bottom: 28px;
}

/* =========================
  ✅ スマホ最適化【ここだけ1回だけ！】
========================= */
@media (max-width: 768px) {

  #weatherTable th,
  #weatherTable td {
    padding: 4px 2px;
    font-size: 11px;
    text-align: center;
    vertical-align: middle;
    word-break: break-word;
  }

  /* ✅ 1列目だけ狭く */
  #weatherTable th:first-child,
  #weatherTable td:first-child {
    width: 12%;
  }

  /* ✅ 残り7列を完全均等 */
  #weatherTable th:not(:first-child),
  #weatherTable td:not(:first-child) {
    width: calc(88% / 7);
  }

  /* ✅ 天気アイコン縮小 */
  .weather-icon {
    font-size: 1.6rem;
  }

  .weather-modal-content {
    width: 96%;
    padding: 12px;
  }
}
