.bfdb-wrap {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  color: #1e293b;
  max-width: 100%;
  margin: 0 auto;
}
.bfdb-h2 {
  font-size: 1.35rem;
  border-left: 4px solid #0284c7;
  padding-left: 10px;
  margin: 24px 0 14px;
}
.bfdb-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.bfdb-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px;
}
.bfdb-card-label {
  font-size: 0.85rem;
  color: #475569;
  font-weight: 700;
  margin-bottom: 8px;
}
.bfdb-card-val {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
}
.bfdb-card-sub {
  font-size: 0.82rem;
  color: #475569;
  margin-top: 6px;
  line-height: 1.5;
}
.bfdb-rep-temps {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bfdb-rep-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 0.9rem;
  border-bottom: 1px dashed #e2e8f0;
  padding-bottom: 4px;
}
.bfdb-rep-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.bfdb-rep-name {
  white-space: nowrap;
  color: #334155;
}
.bfdb-rep-val {
  white-space: nowrap;
  font-size: 1rem;
}
.trend-up { color: #dc2626; font-weight: 700; }
.trend-down { color: #2563eb; font-weight: 700; }
.trend-neutral { color: #334155; font-weight: 700; }
.bfdb-nodata { color: #94a3b8; font-weight: 600; font-size: 0.9rem; }

.bfdb-wind-box,
.bfdb-station-wind-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  margin-top: 12px;
}
.bfdb-wind-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}
.bfdb-wind-label {
  font-size: 0.82rem;
  color: #475569;
}
.bfdb-select {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.85rem;
  background: #f8fafc;
}
.bfdb-wind-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.bfdb-wind-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  text-align: center;
}
.bfdb-wind-table th, .bfdb-wind-table td {
  border: 1px solid #e2e8f0;
  padding: 6px 8px;
  white-space: nowrap;
}
.bfdb-wind-table th:first-child {
  background: #f1f5f9;
  position: sticky;
  left: 0;
  z-index: 1;
  text-align: left;
}
.bfdb-wind-arrow {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
}
.bfdb-wind-strong {
  color: #dc2626;
  font-weight: 700;
}

.bfdb-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.bfdb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  min-width: 680px;
}
.bfdb-table th, .bfdb-table td {
  border-bottom: 1px solid #e2e8f0;
  padding: 10px 8px;
  text-align: left;
  white-space: nowrap;
}
.bfdb-table th {
  background: #f1f5f9;
  font-weight: 700;
}
.bfdb-group-row td {
  font-weight: 700;
  font-size: 0.85rem;
  padding: 7px 10px;
}
.bfdb-group-nanko td {
  background: #e0f2fe;
  color: #0369a1;
}
.bfdb-group-hokkoku td {
  background: #dcfce7;
  color: #15803d;
}
.bfdb-anchor-link {
  color: #0284c7;
  font-weight: 700;
  text-decoration: underline;
}
.bfdb-detail-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 18px;
}
.bfdb-detail-head h3 {
  margin: 0 0 4px;
  font-size: 1.15rem;
}
.bfdb-area-tag {
  font-size: 0.75rem;
  background: #e0f2fe;
  color: #0369a1;
  padding: 2px 8px;
  border-radius: 4px;
  vertical-align: middle;
}
.bfdb-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.bfdb-metric {
  background: #f8fafc;
  padding: 10px;
  border-radius: 8px;
}
.bfdb-metric span { display: block; font-size: 0.78rem; color: #64748b; }
.bfdb-metric strong { display: block; font-size: 1.1rem; margin: 2px 0; }
.bfdb-metric small { font-size: 0.76rem; color: #475569; }
.bfdb-chart-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  margin-top: 12px;
}
.bfdb-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.bfdb-tabs { display: flex; gap: 6px; }
.bfdb-tab {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
}
.bfdb-tab.active {
  background: #0284c7;
  color: #fff;
  border-color: #0284c7;
}
.bfdb-note {
  font-size: 0.8rem;
  color: #64748b;
  margin: 4px 0 8px;
}
.bfdb-footer {
  margin-top: 24px;
  padding: 14px;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 0.8rem;
  color: #475569;
  line-height: 1.6;
}

/* === 高山ダム用レスポンシブレイアウト === */
.bfdb-tk-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}
.bfdb-tk-full {
  grid-column: 1 / -1;
}
.bfdb-tk-diffs {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.9rem;
  margin-bottom: 10px;
}
.bfdb-tk-temp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-bottom: 10px;
}
.bfdb-badge-obs, .bfdb-badge-fcst {
  display: inline-block;
  font-size: 0.68rem;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 700;
  margin-top: 2px;
}
.bfdb-badge-obs {
  background: #e0f2fe;
  color: #0369a1;
}
.bfdb-badge-fcst {
  background: #fef3c7;
  color: #b45309;
}
.bfdb-sample-banner {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  color: #92400e;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 14px;
}
.bfdb-h3 {
  font-size: 1.05rem;
  margin: 0 0 10px;
  color: #0f172a;
}
.bfdb-tk-wind-val {
  font-size: 1.2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}
.bfdb-tk-wind-dir {
  color: #1e293b;
}

@media (max-width: 600px) {
  .bfdb-chart-box {
    padding: 8px;
  }
  .bfdb-tab {
    padding: 6px 12px;
    font-size: 0.85rem;
  }
}

.bfdb-tk-updated {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 6px;
}
.bfdb-tk-stale {
  color: #b45309;
  font-weight: 600;
}
.bfdb-tk-rain-grid {
  grid-template-columns: repeat(2, 1fr);
}
.bfdb-tk-ref-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: #b45309;
  background: #fef3c7;
  padding: 1px 6px;
  border-radius: 4px;
  vertical-align: middle;
}

/* 淀川は1画面構成のため高山ダム共通のレスポンシブカード・グラフスタイルを利用 */
