/* ─── エリアプライス ─── */

:root {
  --ap-brand-green: #2F9E5F;
  --ap-brand-green-dark: #1F7A47;
  --ap-brand-green-light: #E8F6EE;
  --ap-bg-grad: linear-gradient(135deg, #DDEFE3 0%, #F2F7F3 45%, #FFFFFF 100%);
  --ap-card-bg: #FFFFFF;
  --ap-card-radius: 18px;
  --ap-card-shadow: 0 4px 18px rgba(31, 122, 71, 0.08);
  --ap-text-main: #2B2B2B;
  --ap-text-sub: #555;
  --ap-text-muted: #888;
  --ap-border: #E6ECE8;
  --ap-chart-orange: #F59E3C;
  --ap-chart-orange-fill: rgba(245, 158, 60, 0.28);
  --ap-summary-green: linear-gradient(135deg, #3FB172 0%, #2F9E5F 100%);
  --ap-summary-orange: linear-gradient(135deg, #F7B36A 0%, #EB8A3E 100%);
  --ap-summary-purple: linear-gradient(135deg, #A48CC9 0%, #7E5DB0 100%);
}

* { box-sizing: border-box; }

body {
  font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
  margin: 0;
  min-height: 100vh;
  background: var(--ap-bg-grad);
  background-attachment: fixed;
  color: var(--ap-text-main);
}

/* ── ページヒーロー（旧 site-header 廃止） ── */
.page-hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 24px 8px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.page-hero__icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.page-hero__icon img,
.page-hero__icon svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.page-hero__titles {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.page-hero__title {
  margin: 0;
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, #1F7A47 0%, #3FB172 55%, #BBD94A 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.page-hero__sub {
  margin-bottom: 2px;
  font-size: 0.78rem;
  color: var(--ap-text-sub);
  letter-spacing: 0.02em;
}
.page-hero__note {
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  margin-left: 6px;
  color: var(--ap-text-muted);
  -webkit-text-fill-color: var(--ap-text-muted);
  background: none;
}

/* ── パンくず ── */
.breadcrumb-nav {
  width: 100%;
  background: rgba(255, 255, 255, 0.65);
  border-bottom: 1px solid var(--ap-border);
  padding: 8px 0;
  margin: 0;
}
.breadcrumb-nav .breadcrumb {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  background: transparent;
  font-size: 0.78rem;
}
.breadcrumb-nav .breadcrumb-item + .breadcrumb-item::before {
  color: var(--ap-text-muted);
}
.breadcrumb-nav .breadcrumb a {
  color: var(--ap-brand-green-dark);
  text-decoration: none;
}
.breadcrumb-nav .breadcrumb a:hover {
  text-decoration: underline;
}
.breadcrumb-nav .breadcrumb-item.active {
  color: var(--ap-text-sub);
}

/* ── メインコンテンツ ── */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px 40px;
  overflow-x: hidden;
}

/* ── 共通カード ── */
.ap-card {
  background: var(--ap-card-bg);
  border-radius: var(--ap-card-radius);
  box-shadow: var(--ap-card-shadow);
  padding: 18px 22px;
  margin-bottom: 18px;
}
.ap-card__label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ap-brand-green-dark);
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

/* ── エリア選択 ── */
.area-nav {
  /* .ap-card が当たる */
}
.area-nav-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 8px;
  padding: 0;
  margin: 0;
}
.area-nav-list li {
  border-right: none;
  display: flex;
}
.area-nav-list a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 6px;
  min-height: 56px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.15;
  border: 1.5px solid transparent;
  border-radius: 8px;
  background: var(--area-c-light, #fff);
  color: var(--area-c-dark, var(--ap-text-main));
  transition: filter 0.15s, background 0.15s, color 0.15s, border-color 0.15s;
  cursor: pointer;
  white-space: nowrap;
}
.area-nav-list a:hover:not(.active) {
  filter: brightness(0.94);
}
.area-nav-list a.active {
  color: #fff;
  background: var(--area-c-dark, var(--ap-brand-green));
  border-color: var(--area-c-dark, var(--ap-brand-green));
}

/* 虹配色（エリアごとに薄色→選択時は濃色+白抜き） */
.area-nav-list a.area-01 { --area-c-light: #FFEBEE; --area-c-dark: #E53935; }
.area-nav-list a.area-02 { --area-c-light: #FFF3E0; --area-c-dark: #F57C00; }
.area-nav-list a.area-03 { --area-c-light: #FFFDE7; --area-c-dark: #F9A825; }
.area-nav-list a.area-04 { --area-c-light: #E8F5E9; --area-c-dark: #43A047; }
.area-nav-list a.area-05 { --area-c-light: #E0F7FA; --area-c-dark: #00ACC1; }
.area-nav-list a.area-06 { --area-c-light: #E3F2FD; --area-c-dark: #1E88E5; }
.area-nav-list a.area-07 { --area-c-light: #E8EAF6; --area-c-dark: #3949AB; }
.area-nav-list a.area-08 { --area-c-light: #F3E5F5; --area-c-dark: #8E24AA; }
.area-nav-list a.area-09 { --area-c-light: #FCE4EC; --area-c-dark: #D81B60; }

/* ── コントロール行 ── */
.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.controls-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.controls-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* タブ（月間/日毎）をピル型トグルに */
.nav-tabs {
  border-bottom: none;
  gap: 8px;
  margin: 0;
}
.nav-tabs .nav-link {
  color: var(--ap-text-sub);
  font-size: 0.85rem;
  font-weight: 600;
  border: 1.5px solid var(--ap-border);
  border-radius: 999px;
  padding: 6px 18px;
  background: #fff;
}
.nav-tabs .nav-link:hover:not(.active) {
  color: var(--ap-brand-green-dark);
  border-color: var(--ap-brand-green);
}
.nav-tabs .nav-link.active {
  color: #fff;
  background: var(--ap-brand-green-dark);
  border-color: var(--ap-brand-green-dark);
}

/* 曜日フィルタ */
.day-category-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--ap-text-sub);
}
.day-category-controls .form-select {
  width: auto;
  min-width: 96px;
  border-radius: 999px;
  border: 1.5px solid var(--ap-border);
  font-size: 0.85rem;
  padding: 4px 28px 4px 12px;
  background-color: #fff;
}
.day-category-controls .form-select:focus {
  border-color: var(--ap-brand-green);
  box-shadow: 0 0 0 3px rgba(47, 158, 95, 0.15);
}

/* 日付コントロール（< 2026/04/22 >） */
.date-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fff;
  border: 1.5px solid var(--ap-border);
  border-radius: 999px;
  padding: 2px 6px;
}
.date-controls .btn {
  background: transparent;
  border: none;
  color: var(--ap-text-sub);
  font-size: 0.95rem;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 999px;
}
.date-controls .btn:hover {
  background: var(--ap-brand-green-light);
  color: var(--ap-brand-green-dark);
}
.date-picker-input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ap-text-main);
  width: auto;
  min-width: 120px;
  padding: 2px 4px;
  text-align: center;
}
.date-picker-input:focus {
  box-shadow: none;
}

/* ── 平均値ボックス（3色カード） ── */
.summary-boxes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.summary-box {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 98px;
  padding: 14px 18px;
  border-radius: var(--ap-card-radius);
  color: #fff;
  box-shadow: var(--ap-card-shadow);
  overflow: hidden;
}
.summary-box--green { background: var(--ap-summary-green); }
.summary-box--orange { background: var(--ap-summary-orange); }
.summary-box--purple { background: var(--ap-summary-purple); }
.summary-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: 0.02em;
}
.summary-value-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.summary-value {
  font-size: 1.9rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
}
.summary-unit {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.88);
}
.summary-icon {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 22px;
  height: 22px;
  color: rgba(255, 255, 255, 0.85);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.summary-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

/* ── グラフ ── */
.chart-card { }
.chart-title {
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ap-text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}
.chart-title::before {
  content: '';
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: var(--ap-brand-green);
}
.chart-container {
  position: relative;
  height: 320px;
}

/* ── データテーブル ── */
.data-tables-wrapper {
  display: flex;
  gap: 16px;
  width: 100%;
}
.data-table-half {
  flex: 1;
  min-width: 0;
}
.data-table-half .table {
  font-size: 0.78rem;
  margin-bottom: 0;
  border-color: var(--ap-border);
}
.data-table-half .table th {
  background: var(--ap-brand-green);
  color: #fff;
  font-weight: 600;
  font-size: 0.75rem;
  border-color: var(--ap-brand-green);
}
.data-table-half .table td {
  padding: 3px 8px;
  color: var(--ap-text-main);
}

/* ── データなしメッセージ ── */
.no-data-msg {
  text-align: center;
  color: var(--ap-text-muted);
  padding: 40px 0;
  font-size: 0.9rem;
}

/* ── JEPX 説明ボックス ── */
.info-box {
  padding: 4px 4px;
}
.info-section {
  border-bottom: 1px solid var(--ap-border);
}
.info-section:last-child {
  border-bottom: none;
}
.info-heading {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ap-text-main);
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}
.info-heading::-webkit-details-marker {
  display: none;
}
.info-heading::before {
  content: '▶';
  display: inline-block;
  font-size: 0.65rem;
  color: var(--ap-brand-green);
  margin-right: 8px;
  transition: transform 0.2s;
}
details[open] > .info-heading::before {
  transform: rotate(90deg);
}
.info-section p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ap-text-sub);
  line-height: 1.6;
  padding: 0 12px 12px;
}

/* ── 注釈 ── */
.note {
  font-size: 0.75rem;
  color: var(--ap-text-muted);
  margin: 16px 2px 0;
}

/* ── フッター ── */
.site-footer {
  min-height: 40px;
}

/* ── レスポンシブ: タブレット (481px〜768px) ── */
@media (max-width: 768px) and (min-width: 481px) {
  .page-hero { padding: 18px 18px 6px; }
  .page-hero__title { font-size: 1.55rem; }
  .main-content { padding: 12px 18px 32px; }
  .ap-card { padding: 14px 16px; }
  .area-nav-list { grid-template-columns: repeat(5, 1fr); }
  .area-nav-list li:nth-child(n+10) { display: none; }
  .summary-boxes { gap: 10px; }
  .summary-box { min-height: 86px; padding: 12px 14px; }
  .summary-value { font-size: 1.5rem; }
  .chart-container { height: 280px; }
}

/* ── レスポンシブ: モバイル (〜480px) ── */
@media (max-width: 480px) {
  .page-hero {
    padding: 18px 16px 4px;
    gap: 10px;
  }
  .page-hero__icon { width: 36px; height: 36px; flex-basis: 36px; }
  .page-hero__title { font-size: 1.3rem; }
  .page-hero__sub { font-size: 0.7rem; }
  .breadcrumb-nav .breadcrumb { padding: 0 16px; }
  .main-content { padding: 10px 16px 28px; }
  .ap-card { padding: 12px 14px; border-radius: 14px; }

  .area-nav-list { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .area-nav-list a { font-size: 0.82rem; padding: 12px 4px; min-height: 48px; }

  .controls-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .controls-left, .controls-right { justify-content: center; }
  .nav-tabs { justify-content: center; }
  .date-picker-input { min-width: 110px; font-size: 0.82rem; }

  .summary-boxes { grid-template-columns: 1fr; gap: 10px; }
  .summary-box { min-height: 80px; padding: 12px 16px; }
  .summary-value { font-size: 1.6rem; }

  .chart-container { height: 240px; }
  .chart-title { font-size: 0.88rem; }

  .data-tables-wrapper { flex-direction: column; gap: 0; }
  .data-table-half { width: 100%; }
  .data-table-half:first-child .table { border-bottom: none; margin-bottom: 0; }
}
