/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* 丸ゴシック系（正式: FOT-筑紫A丸ゴシック Std。未読込時は Zen Maru Gothic 代替） */
  --font-round: fot-tsukuardgothic-std, 'Zen Maru Gothic', 'Noto Sans JP', sans-serif;
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: var(--font-round);
  background: #F6F4DC;
  color: #2c2c2c;
}

/* ============================================================
   Page System
   ============================================================ */
.page {
  position: absolute; inset: 0;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.page.active {
  display: flex;
  flex-direction: column;
}
.page.visible { opacity: 1; }

/* ============================================================
   Sidebar (right nav)
   ============================================================ */
.sidebar {
  position: fixed;
  right: 0; top: 0; bottom: 0;
  width: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 14px 5px;
  z-index: 100;
  background: transparent;
}

.nav-btn {
  --nav-color: #1a2f5e;
  background: none;
  border: none;
  padding: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  gap: 4px;
  color: var(--nav-color);
  transition: transform 0.15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.nav-btn:active { transform: scale(0.93); }
.nav-circle {
  width: 40px; height: 40px;
  flex: 0 0 auto;
  box-sizing: border-box;
  border-radius: 50%;
  border: 2px solid var(--nav-color);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.nav-btn .icon { font-size: 14px; line-height: 1; color: var(--nav-color); display: flex; align-items: center; justify-content: center; }
.nav-label { letter-spacing: 0.04em; font-weight: 400; font-size: 9px; }
.nav-btn:hover .nav-circle { background: var(--nav-color); }
.nav-btn:hover .icon { color: #fff; }

.nav-btn-home { --nav-color: #1a2f5e; }
.nav-btn-prev { --nav-color: #1a2f5e; }
.nav-btn-movie { --nav-color: #1a2f5e; }
.nav-btn[hidden] { display: none; }

/* HOMEページではサイドバー（HOME/PREV）を非表示 */
body.is-home .sidebar { display: none; }

/* ============================================================
   Section Badge (top-left)
   ============================================================ */
.section-badge {
  position: absolute;
  width: 168px; height: 168px;
  top: -67px; left: 40px;
  border-radius: 50%;
  border: 5px solid rgba(255, 255, 255, 0.45);
  display: flex; align-items: flex-end; justify-content: center;
  text-align: center;
  padding-bottom: 34px;
  font-family: var(--font-round);
  font-size: 19px;
  font-weight: 400;
  line-height: 1.35;
  color: #fff;
  z-index: 10;
}

/* ============================================================
   Page Layout Wrapper
   ============================================================ */
.page-inner {
  flex: 1;
  padding: 24px 42px 16px 32px; /* right: sidebar width */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.page-title {
  font-family: var(--font-round);
  font-size: clamp(22px, 3.2vw, 42px);
  font-weight: 400;
  color: #1a2f5e;
  margin: 0 0 32px 0;
  padding-top: 10px;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-align: center;
}
.page-title.has-badge { padding-left: 100px; padding-right: 100px; }

.page-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 40px;
  padding-top: 10px;
}
.page-title-row .page-title {
  margin: 0;
  text-align: left;
  flex: 0 1 auto;
}
.page-title-row .page-title.has-badge {
  padding-left: 0;
  padding-right: 0;
}

.title-illust {
  flex: 0 0 auto;
  height: clamp(52px, 7.5vh, 84px);
  object-fit: contain;
  pointer-events: none;
}

.page-title-block {
  flex: 0 1 auto;
  text-align: center;
}
.page-title-block .page-title {
  margin: 0;
}
.page-subtitle {
  font-family: var(--font-round);
  font-size: clamp(14px, 1.5vw, 20px);
  font-weight: 400;
  color: #1a2f5e;
  letter-spacing: 0.04em;
  margin: 6px 0 0 0;
  line-height: 1.4;
}
.p11-title .title-em {
  font-size: 1.28em;
  font-weight: 400;
}

.page-note {
  font-size: 10px;
  color: #666;
  line-height: 1.5;
  margin-top: auto;
  padding-top: 8px;
}

/* ============================================================
   HOME Page
   ============================================================ */
#page-home .page-inner {
  padding: 56px 48px;
  justify-content: center;
}
.home-title {
  font-family: var(--font-round);
  font-size: clamp(22px, 2.8vw, 42px);
  font-weight: 400;
  color: #1a2f5e;
  text-align: center;
  letter-spacing: 0.04em;
  margin-bottom: 28px;
}
.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 36px 48px;
  flex: 1;
  max-height: calc(100vh - 140px);
  padding: 6px 12px 16px;
}
.home-card {
  --card-color: #00B5AD;
  --tile-h: clamp(160px, 27vh, 260px);
  background: #fff;
  border-radius: 14px;
  border: none;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 26px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  gap: 42px;
  box-shadow: 6px 6px 0 0 var(--card-color);
}
.home-card.border-teal   { --card-color: #01AEBE; }
.home-card.border-green  { --card-color: #6BBB5A; }
.home-card.border-pink   { --card-color: #E85780; }
.home-card.border-purple { --card-color: #91539C; }
.home-card:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 0 var(--card-color); }
.home-card:active { transform: translate(3px, 3px); box-shadow: 3px 3px 0 0 var(--card-color); }
.home-card-label {
  flex: 1 1 0;
  white-space: nowrap;
  color: #fff;
  font-family: var(--font-round);
  font-size: clamp(20px, 2.6vw, 36px);
  font-weight: 400;
  line-height: 1.45;
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  height: var(--tile-h);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-color);
  border: 7px solid color-mix(in srgb, var(--card-color) 45%, #fff);
}
.home-card-img {
  flex: 1 1 0;
  min-width: 0;
  height: var(--tile-h);
  width: 100%;
  object-fit: contain;
}
.home-card-img-placeholder {
  flex: 1 1 0;
  min-width: 0;
  height: 140px;
  display: flex; align-items: center; justify-content: center;
  font-size: 60px;
}

/* ============================================================
   Submenu Pages (P2, P5, P8)
   ============================================================ */
.page:has(.submenu-grid) .page-inner {
  justify-content: center;
}
.submenu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px 48px;
  flex: 0 0 auto;
  align-content: center;
  max-height: calc(100vh - 200px);
  padding: 0 16px;
}
.submenu-card {
  --submenu-color: #01AEBE;
  background: #fff;
  border-radius: 16px;
  border: 3px solid var(--submenu-color);
  border-top: none;
  border-left: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 52px 28px 48px;
  cursor: pointer;
  transition: transform 0.15s;
  gap: 20px;
  min-height: 280px;
}
.submenu-card.submenu-teal  { --submenu-color: #01AEBE; }
.submenu-card.submenu-green { --submenu-color: #6BBB5A; }
.submenu-card.submenu-pink  { --submenu-color: #E85780; }
.submenu-card.submenu-blue  { --submenu-color: #2196F3; }
.submenu-card.submenu-purple { --submenu-color: #91539C; }
.submenu-card { box-shadow: 3px 3px 0 0 var(--submenu-color); }
.submenu-card:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 0 var(--submenu-color); }
.submenu-card:active { transform: translate(1px, 1px); box-shadow: 2px 2px 0 0 var(--submenu-color); }
.submenu-card-img {
  flex: 1 1 auto;
  width: 100%;
  min-height: 120px;
  max-height: clamp(140px, 28vh, 320px);
  object-fit: contain;
}
.submenu-card-img-placeholder {
  font-size: clamp(60px, 8vw, 100px);
  opacity: 0.7;
}
.submenu-card-btn {
  flex: 0 0 auto;
  margin-top: auto;
  padding: 14px 28px;
  border-radius: 12px;
  border: 4px solid color-mix(in srgb, var(--submenu-color) 45%, #fff);
  color: #fff;
  font-family: var(--font-round);
  font-size: clamp(14px, 1.6vw, 20px);
  font-weight: 400;
  background: var(--submenu-color);
  width: 100%;
  text-align: center;
  box-sizing: border-box;
  pointer-events: none;
}

/* ============================================================
   Toggle Buttons (共通)
   ============================================================ */
.toggle-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.toggle-btn {
  padding: 8px 20px;
  border-radius: 30px;
  border: 2px solid;
  font-size: clamp(12px, 1.1vw, 15px);
  font-weight: 700;
  cursor: pointer;
  background: transparent;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.toggle-btn.active {
  color: #fff !important;
}

/* ============================================================
   P3 ふるさと納税
   ============================================================ */
#page-p3 .page-inner {
  gap: 0;
  justify-content: center;
}

#page-p3 .page-title {
  margin-bottom:50px;
}

.p3-layout {
  display: grid;
  grid-template-columns: 1.04fr 0.96fr;
  grid-template-rows: auto auto auto auto auto auto;
  column-gap: clamp(24px, 3vw, 56px);
  row-gap: clamp(3px, 0.5vh, 6px);
  flex: 0 0 auto;
  min-height: 0;
  align-items: stretch;
  align-content: start;
  overflow: hidden;
  
}

.p3-toggle-group  { grid-column: 1; grid-row: 1; }
.p3-deduction     { grid-column: 1; grid-row: 2; }
.p3-gifts-header  { grid-column: 1; grid-row: 3; }
.p3-breakdown     { grid-column: 1; grid-row: 4; }
.p3-products      { grid-column: 1; grid-row: 5; }
.p3-right         { grid-column: 2; grid-row: 1 / 6; }
.p3-note          { grid-column: 1 / -1; grid-row: 6; }

/* P3はすべてボルドなし（font-weight: 400） */
#page-p3 .page-title,
.p3-income-btn,
.p3-deduction-line,
.p3-deduction-label,
.p3-deduction-amount,
.p3-yen-pre,
.p3-deduction-num,
.p3-yen-suf,
.p3-deduction-sub,
.p3-gifts-title,
.p3-total-label,
.p3-total-amount,
.p3-total-num,
.p3-breakdown,
.p3-breakdown-label,
.p3-breakdown-text,
.p3-prod-origin,
.p3-prod-unit,
.p3-plus {
  font-weight: 400;
}

/* --- 年収トグル --- */
.p3-toggle-group {
  display: flex;
  gap: clamp(12px, 1.4vw, 22px);
  flex: 0 0 auto;
}
.p3-income-btn {
  padding: 8px 20px;
  border-radius: 999px;
  border: 2px solid;
  font-family: var(--font-round);
  font-size: clamp(12px, 1.05vw, 18px);
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
/* 400万＝オレンジ枠(白地) / 500万＝ピンク塗り（PDF準拠の固定スタイル） */
.p3-income-orange {
  border-color: #F5A623;
  background: #fff;
  color: #F5A623;
}
.p3-income-pink {
  border-color: #E91E8C;
  background: #E91E8C;
  color: #fff;
}
.p3-income-orange.active { background: #FDEFD9; }
.p3-income-pink.active { box-shadow: 0 0 0 3px rgba(233, 30, 140, 0.28); }

/* --- 控除上限額 --- */
.p3-deduction {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 16px 22px 14px;
  flex: 0 0 auto;
}
.p3-deduction::after {
  content: '';
  position: absolute;
  bottom: -14px;
  left: 84px;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-top: 15px solid #fff;
}
.p3-deduction-line {
  margin: 0;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 6px;
  color: #1a2f5e;
  font-size: clamp(16px, 1.7vw, 26px);
}
.p3-deduction-amount {
  display: inline-flex;
  align-items: baseline;
}
.p3-yen-pre {
  font-size: clamp(16px, 1.7vw, 26px);
  transition: color 0.3s;
}
.p3-deduction-num {
  font-size: clamp(32px, 4.4vw, 64px);
  line-height: 1;
  transition: color 0.3s;
}
.p3-yen-suf {
  font-size: clamp(20px, 2.4vw, 36px);
  transition: color 0.3s;
}
.p3-deduction-sub {
  margin: 4px 0 0;
  font-size: clamp(11px, 1.15vw, 16px);
  color: #444;
}

/* --- 返礼品ヘッダー --- */
.p3-gifts-header {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.4vw, 20px);
  padding-left: 6px;
  flex: 0 0 auto;
}
.p3-gifts-title-row {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1vw, 16px);
  min-width: 0;
}
.p3-gifts-icon {
  flex: 0 0 auto;
  width: clamp(38px, 3.6vw, 60px);
  height: auto;
  object-fit: contain;
}
.p3-gifts-title {
  font-size: clamp(13px, 1.4vw, 21px);
  color: #1a2f5e;
  line-height: 1.35;
}
.p3-total-box {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: clamp(6px, 0.8vw, 12px);
}
.p3-total-label {
  font-size: clamp(10px, 1vw, 15px);
  color: #fff;
  background: #01AEBE;
  border-radius: 8px;
  padding: clamp(4px, 0.6vh, 8px) clamp(8px, 0.8vw, 12px);
  text-align: center;
  line-height: 1.2;
}
.p3-total-amount {
  display: inline-flex;
  align-items: baseline;
}
.p3-total-num {
  font-size: clamp(26px, 3.6vw, 52px);
  line-height: 1;
  transition: color 0.3s;
}

/* --- 内訳 --- */
.p3-breakdown {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1vw, 14px);
  font-size: clamp(10px, 1.1vw, 16px);
  color: #333;
  flex: 0 0 auto;
}
.p3-breakdown-label {
  flex: 0 0 auto;
  align-self: flex-start;
  margin-top: 2px;
  font-size: clamp(10px, 1vw, 15px);
  color: #fff;
  background: #01AEBE;
  border-radius: 6px;
  padding: 3px 10px;
}
.p3-breakdown-text {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}

/* --- 返礼品 3点（画像行＋ラベル行のグリッド） --- */
.p3-products {
  display: grid;
  grid-template-columns:
    clamp(108px, 10.5vw, 156px)
    clamp(32px, 3.2vw, 56px)
    clamp(108px, 10.5vw, 156px)
    clamp(32px, 3.2vw, 56px)
    clamp(108px, 10.5vw, 156px);
  grid-template-rows: minmax(60px, 10.5vh) auto;
  column-gap: 0;
  row-gap: 0;
  width: fit-content;
  max-width: 100%;
  min-height: 0;
}
.p3-prod-img {
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}
.p3-prod-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.p3-plus {
  grid-row: 1;
  align-self: center;
  justify-self: center;
  font-size: clamp(20px, 2.4vw, 38px);
  color: #01AEBE;
  line-height: 1;
}
.p3-prod-label {
  grid-row: 2;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1px;
  padding-top: 1px;
}
.p3-prod-origin {
  font-size: clamp(10px, 1.05vw, 15px);
  color: #1a2f5e;
  text-align: center;
  line-height: 1.2;
}
.p3-prod-unit {
  display: block;
  width: 100%;
  box-sizing: border-box;
  background: #01AEBE;
  color: #fff;
  border-radius: 999px;
  padding: 4px 6px;
  font-size: clamp(9px, 0.95vw, 13px);
  text-align: center;
  white-space: nowrap;
}

/* --- 収納ビジュアル（右・白背景カード） --- */
.p3-right {
  background: #fff;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  padding: 24px;
  min-height: 0;
  overflow: hidden;
  box-sizing: border-box;
}
.p3-storage-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.p3-note {
  margin-top: 6px;
}

/* ============================================================
   P4 プランニング
   ============================================================ */
#page-p4 .page-inner {
  justify-content: center;
}

.p4-title {
  
  margin-bottom: clamp(6px, 1.4vh, 16px);
}

.p4-intro {
  text-align: center;
  margin-bottom: clamp(10px, 2vh, 22px);
}
.p4-intro-head {
  margin: 0 0 4px;
  font-family: var(--font-round);
  font-size: clamp(14px, 1.5vw, 22px);
  color: #0E8E97;
}
.p4-intro-desc {
  margin: 0;
  font-size: clamp(12px, 1.2vw, 17px);
  color: #444;
  line-height: 1.6;
}
.p4-emph {
  color: #E50C1D;
}

.p4-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) clamp(180px, 20vw, 300px);
  grid-template-rows: auto auto;
  align-items: start;
  column-gap: clamp(12px, 1.8vw, 32px);
  row-gap: clamp(8px, 1.4vh, 16px);
  flex: 0 0 auto;
  min-height: 0;
}

.p4-plan-before { grid-column: 1; grid-row: 1; }
.p4-plan-after  { grid-column: 3; grid-row: 1; position: relative; }
.p4-arrow       { grid-column: 2; grid-row: 1; align-self: center; }
.p4-badge       { grid-column: 3; grid-row: 2; justify-self: center; }
.p4-photo       { grid-column: 4; grid-row: 1 / span 2; }

.p4-plan-before img,
.p4-plan-after img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}
.p4-plan-highlight {
  position: absolute;
  left: 4.5%;
  top: 5.5%;
  width: 34%;
  height: 30%;
  background: rgba(120, 205, 210, 0.5);
  pointer-events: none;
}

.p4-arrow {
  font-size: clamp(22px, 2.6vw, 40px);
  color: #01AEBE;
}

.p4-badge {
  background: #01AEBE;
  color: #fff;
  padding: clamp(6px, 1vh, 11px) clamp(14px, 1.6vw, 26px);
  border-radius: 999px;
  font-size: clamp(11px, 1.15vw, 16px);
  text-align: center;
  line-height: 1.3;
}

.p4-photo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.p4-photo-imgwrap {
  width: 100%;
  flex: 1;
  min-height: 0;
  border-radius: 6px;
  overflow: hidden;
}
.p4-photo-imgwrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.p4-photo-caption {
  align-self: flex-end;
  font-size: clamp(9px, 0.9vw, 13px);
  color: #888;
}

.p4-catch {
  margin: clamp(10px, 2vh, 24px) 0 0;
  text-align: center;
  font-family: var(--font-round);
  font-size: clamp(16px, 2vw, 30px);
  color: #1a2f5e;
}

/* ============================================================
   P6 断熱等級 チャート
   ============================================================ */
#page-p6 .page-title {
  margin-top: clamp(30px, 5vh, 58px);
  margin-bottom:50px;
}
#page-p6 .toggle-group {
  margin-bottom: clamp(8px, 1.4vh, 14px);
}
.p6-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}
.p6-chart-area {
  display: flex; flex-direction: column; gap: 12px;
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  min-height: 0;
}
.p6-chart-label { font-size: 12px; color: #555; font-weight: 600; }
.p6-chart-wrap { flex: 1; position: relative; min-height: 0; }

.p6-right {
  display: flex; flex-direction: column;
  gap: clamp(8px, 1.4vh, 16px);
  overflow: hidden;
  min-height: 0;
}

.p6-cost-block {
  display: flex; flex-direction: column;
  gap: clamp(6px, 1vh, 10px);
}
.p6-cost-label {
  font-family: var(--font-round);
  font-size: clamp(13px, 1.3vw, 18px);
  color: #3a3a3a;
}

.p6-pill-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(6px, 0.8vw, 14px);
}
.p6-pill {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  padding: clamp(7px, 1vh, 11px) clamp(7px, 0.7vw, 11px);
  display: flex; align-items: center;
  gap: clamp(2px, 0.4vw, 6px);
  white-space: nowrap;
  min-width: 0;
  transition: opacity 0.3s;
}
.p6-pill.is-dim { opacity: 0.4; }
.p6-pill-badge {
  flex: 0 0 auto;
  color: #fff;
  border-radius: 6px;
  padding: 3px 6px;
  font-size: clamp(9px, 0.85vw, 12px);
  font-family: var(--font-round);
}
.p6-pill-pre {
  font-size: clamp(10px, 0.9vw, 13px);
  color: #333;
}
.p6-pill-num {
  font-family: var(--font-round);
  font-size: clamp(14px, 1.7vw, 24px);
  color: #E50C1D;
  line-height: 1;
}
.p6-pill-yen {
  font-size: clamp(10px, 0.95vw, 13px);
  color: #E50C1D;
}
.p6-pill.is-dim .p6-pill-num,
.p6-pill.is-dim .p6-pill-yen { color: #9a9a9a; }

.p6-diff-row {
  position: relative;
  height: clamp(50px, 7vh, 74px);
  margin-top: clamp(14px, 2vh, 24px);
}
.p6-diff-callout {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  background-image: linear-gradient(#fff, #fff),
    linear-gradient(90deg, var(--ca) 0 50%, var(--cb) 50% 100%);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  border: 3px solid transparent;
  border-radius: 12px;
  padding: clamp(6px, 1vh, 11px) clamp(10px, 1.1vw, 18px);
  display: flex; align-items: center;
  gap: clamp(6px, 0.7vw, 12px);
  white-space: nowrap;
}
.p6-diff-callout::before,
.p6-diff-callout::after {
  content: '';
  position: absolute;
  top: clamp(-16px, -1.8vh, -12px);
  width: clamp(18px, 1.8vw, 26px);
  height: clamp(11px, 1.4vh, 16px);
  clip-path: polygon(50% 0, 0 100%, 100% 100%);
}
.p6-diff-callout::before {
  left: 24%;
  transform: translateX(-50%);
  background: var(--ca);
}
.p6-diff-callout::after {
  right: 24%;
  transform: translateX(50%);
  background: var(--cb);
}
.p6-diff-text {
  font-family: var(--font-round);
  font-size: clamp(12px, 1.15vw, 16px);
  color: #333;
}
.p6-diff-num {
  font-family: var(--font-round);
  font-size: clamp(16px, 2vw, 28px);
  color: #E50C1D;
  line-height: 1;
}
.p6-diff-yen {
  font-size: clamp(11px, 1vw, 14px);
  color: #E50C1D;
}

.p6-thermal-panel {
  background: #fff;
  border-radius: 16px;
  padding: 14px 16px;
  flex: 0 0 auto;
  overflow: hidden;
  min-height: 0;
}
.p6-thermal-title { font-size: 11px; color: #555; margin-bottom: 8px; }
.p6-thermal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  height: auto;
  align-items: start;
}
.p6-thermal-item {
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #999;
  text-align: center;
}
.p6-thermal-item img { width: 100%; height: auto; display: block; object-fit: contain; }
.p6-thermal-overlay {
  position: absolute;
  top: 6px; right: 6px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 700;
}

/* ============================================================
   P7 スマート設備 チャート
   ============================================================ */
#page-p7 .page-title {
  margin-top: clamp(30px, 5vh, 58px);
  margin-bottom: 50px;
}
#page-p7 .p7-toggle-group {
  justify-content: center;
  margin-bottom: clamp(8px, 1.4vh, 14px);
}
.p7-layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(10px, 1.4vw, 16px);
  flex: 1;
  overflow: hidden;
  min-height: 0;
}
.p7-chart-area {
  background: #fff;
  border-radius: 16px;
  padding: clamp(12px, 1.4vw, 16px);
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 0.8vh, 10px);
  min-height: 0;
}
.p7-chart-label {
  font-family: var(--font-round);
  font-size: clamp(11px, 1vw, 13px);
  color: #555;
  font-weight: 600;
}
.p7-chart-wrap {
  flex: 1;
  position: relative;
  min-height: 0;
}
.p7-chart-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.p7-fit-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: clamp(34px, 3.2vw, 46px);
  height: clamp(34px, 3.2vw, 46px);
  border-radius: 50%;
  background: #5CB85C;
  color: #fff;
  font-size: clamp(7px, 0.65vw, 9px);
  font-weight: 700;
  line-height: 1.15;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s;
}
.p7-fit-marker.visible { opacity: 1; }
.p7-chart-diff {
  position: absolute;
  display: flex;
  align-items: baseline;
  gap: 3px;
  white-space: nowrap;
  background: #fff;
  border: 2.5px solid transparent;
  border-radius: 10px;
  background-image: linear-gradient(#fff, #fff),
    linear-gradient(180deg, var(--ca, #F5A623) 0 50%, var(--cb, #E91E8C) 50% 100%);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  padding: clamp(3px, 0.5vh, 6px) clamp(7px, 0.8vw, 11px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  opacity: 0;
  transition: opacity 0.3s;
}
.p7-chart-diff.visible { opacity: 1; }
.p7-chart-diff-text {
  font-size: clamp(9px, 0.85vw, 11px);
  color: #333;
}
.p7-chart-diff-num {
  font-family: var(--font-round);
  font-size: clamp(13px, 1.5vw, 20px);
  font-weight: 400;
  color: #E50C1D;
  line-height: 1;
}
.p7-chart-diff-unit {
  font-size: clamp(9px, 0.85vw, 11px);
  color: #E50C1D;
}

.p7-right {
  --p7-tab: clamp(34px, 3.4vw, 48px);
  --p7-colgap: clamp(4px, 0.5vw, 7px);
  display: flex;
  flex-direction: column;
  gap: clamp(5px, 0.9vh, 10px);
  overflow: hidden;
  min-height: 0;
  font-weight: 400;
}
.p7-block-title {
  font-family: var(--font-round);
  font-size: clamp(12px, 1.15vw, 16px);
  color: #1f7a70;
  font-weight: 400;
  margin-bottom: clamp(3px, 0.5vh, 5px);
}
.p7-note-mark { font-size: 0.6em; color: #1f7a70; }
.p7-row-label {
  font-family: var(--font-round);
  font-size: clamp(9px, 0.85vw, 12px);
  color: #444;
  font-weight: 400;
  margin: clamp(2px, 0.4vh, 4px) 0;
}

/* 全行共通グリッド：[1fr] [1fr] [1fr]。左端をラベルに揃える */
.p7-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--p7-colgap);
  align-items: center;
}

.p7-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.08);
  padding: clamp(6px, 0.85vh, 10px) clamp(7px, 0.6vw, 10px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(2px, 0.3vw, 4px);
  min-width: 0;
}
.p7-badge {
  flex: 0 0 auto;
  color: #fff;
  border-radius: 7px;
  padding: 3px 6px;
  font-size: clamp(7.5px, 0.7vw, 10px);
  font-weight: 400;
  white-space: nowrap;
}
.p7-val {
  display: flex;
  align-items: baseline;
  gap: 1px;
  white-space: nowrap;
  min-width: 0;
}
.p7-card:not(.is-shown) .p7-val { visibility: hidden; }
.p7-pre {
  font-size: clamp(7px, 0.72vw, 10px);
  color: #333;
  font-weight: 400;
}
.p7-num {
  font-family: var(--font-round);
  font-size: clamp(13px, 1.55vw, 22px);
  font-weight: 400;
  color: #E50C1D;
  line-height: 1;
}
.p7-yen {
  font-size: clamp(7px, 0.74vw, 10.5px);
  color: #E50C1D;
  font-weight: 400;
}

.p7-arrows {
  margin: clamp(-2px, -0.3vh, 0px) 0;
}
.p7-arrow {
  text-align: center;
  font-size: clamp(11px, 1.2vw, 16px);
  line-height: 1;
}

.p7-post-panel {
  position: relative;
  background: rgba(92, 184, 92, 0.14);
  box-shadow: inset 0 0 0 2px #5CB85C;
  border-radius: 16px;
  padding: clamp(7px, 1vh, 11px) clamp(8px, 0.9vw, 13px) clamp(7px, 1vh, 11px) 0;
  display: flex;
  flex-direction: column;
  gap: clamp(5px, 0.8vh, 9px);
  opacity: 0.5;
  transition: opacity 0.3s, background 0.3s;
}
.p7-post-panel.is-active {
  opacity: 1;
  background: rgba(92, 184, 92, 0.22);
}
.p7-post-tab {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--p7-tab);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 1px;
  background: #5CB85C;
  color: #fff;
  font-family: var(--font-round);
  font-size: clamp(9px, 0.95vw, 13px);
  font-weight: 400;
  letter-spacing: 0.04em;
  border-radius: 14px 0 0 14px;
}
.p7-post-tab span {
  writing-mode: vertical-rl;
  white-space: nowrap;
}
.p7-post-rowlabel {
  font-family: var(--font-round);
  font-size: clamp(8px, 0.78vw, 11px);
  color: #333;
  font-weight: 400;
  line-height: 1.25;
  text-align: center;
  padding-left: var(--p7-tab);
}

/* ============================================================
   P9 / P10 メンテナンス チャート
   ============================================================ */
.maintenance-layout {
  display: grid;
  grid-template-columns: 6fr 4fr;
  gap: 16px;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}
.maintenance-chart-area {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
  min-height: 0;
}
.maintenance-chart-wrap { flex: 1; position: relative; min-height: 0; }
.maintenance-unit { font-size: 11px; color: #666; }

/* P9 メンテナンス項目パネル（チャート上にオーバーレイ） */
.maintenance-tips {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.mnt-tip {
  position: absolute;
  top: calc(22% - 20px);
  height: 46%;
  width: auto;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.18));
}
.mnt-tip-20 { left: 12%; }
.mnt-tip-30 { left: 42%; }

/* P10 メンテナンス項目パネル */
.mnt10-tip {
  position: absolute;
  width: auto;
  bottom: 12%;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.18));
}
.mnt10-tip.is-shown {
  opacity: 1;
  transform: translateY(0);
}
/* 小さい吹き出し（防蟻処理15万円）: 10年・20年 */
.mnt10-tip-10,
.mnt10-tip-20 {
  height: 17%;
}
.mnt10-tip-10 { left: 12%; }
.mnt10-tip-20 { left: 36%; }
/* 大きい吹き出し（足場・外装・防蟻＋イラスト）: 30年 */
.mnt10-tip-30 {
  height: 60%;
  top: 12%;
  bottom: auto;
  left: 62.5%;
}

/* P9 / P10 年数ボタン：角丸・薄いボーダー */
.p9-year-btn,
.p10-year-btn {
  border-radius: 14px;
  border-width: 1.5px;
}
.mnt-tip.is-shown {
  opacity: 1;
  transform: translateY(0);
}

.maintenance-right {
  display: flex; flex-direction: column;
  gap: 12px;
  overflow: hidden;
  min-height: 0;
}
.maintenance-note {
  margin-top: 0;
  padding-top: 0;
  flex: 0 0 auto;
  font-size: 9px;
  line-height: 1.45;
}
.maintenance-photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  flex: 1;
  min-height: 0;
}
.maintenance-photo {
  background: #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
}
/* P10: 写真を横一列（4枚）、合計ボックスを大きく */
.maintenance-photos-row {
  grid-template-columns: repeat(4, 1fr);
  flex: 0 0 auto;
  height: 34%;
}
#page-p10 .maintenance-total-box {
 display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: 20px;
  padding-bottom: 20px;
}
#page-p10 .maintenance-total-amount {
  font-size: clamp(44px, 7vw, 92px);
}
.maintenance-photo img { width: 100%; height: 100%; object-fit: cover; }
.maintenance-photo-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #bbb; text-align: center;
}

.maintenance-total-box {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  border: 3px solid;
}
.maintenance-total-amount {
  font-size: clamp(32px, 5vw, 64px);
  font-weight: 400;
  color: #c00;
  line-height: 1;
}
.maintenance-total-sub {
  font-size: 13px;
  color: #444;
  margin-top: 6px;
}
.maintenance-reserve {
  font-size: 12px;
  color: #666;
  margin-top: 4px;
}

.maintenance-details-panel {
  background: #fff;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 11px;
  color: #444;
  line-height: 1.7;
  overflow-y: auto;
  min-height: 0;
}

/* ============================================================
   P12 将来のご自宅の価値
   ============================================================ */
.p12-layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 20px;
  flex: 1;
  min-height: 0;
}
.p12-chart-area {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  min-height: 0;
}
.p12-toggle-group { flex: 0 0 auto; }
.p12-chart-wrap {
  flex: 1;
  position: relative;
  min-height: 0;
}
.p12-land-label {
  position: absolute;
  left: 54%;
  bottom: 6.3%;
  transform: translateX(-50%);
  width: 28%;
  max-width: 200px;
  height: auto;
  pointer-events: none;
}
.p12-callout {
  position: absolute;
  top: 40%;
  left: 56%;
  background: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: clamp(11px, 1.1vw, 14px);
  color: #2BABE2;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  pointer-events: none;
}
.p12-callout::after {
  content: '';
  position: absolute;
  left: 18px;
  bottom: -8px;
  border-width: 8px 8px 0 8px;
  border-style: solid;
  border-color: #fff transparent transparent transparent;
  filter: drop-shadow(0 2px 1px rgba(0,0,0,0.06));
}
.p12-right {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
}
.p12-right img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* ============================================================
   P13 資産価値シミュレーション（リフォーム費用比較）
   ============================================================ */
.p13-inner {
  padding-top: 16px;
}
.p13-head {
  text-align: center;
  flex: 0 0 auto;
}
.p13-head .p13-title {

  padding-top: 0;
  font-size: clamp(22px, 3vw, 40px);
}
.p13-head .page-subtitle {
  margin-top: 2px;
}

.p13-legend {
  flex: 0 0 auto;
  display: flex;
  gap: clamp(10px, 1.4vw, 20px);
  margin: clamp(8px, 1.4vh, 16px) 0 clamp(4px, 0.8vh, 10px) 20px;
}
.p13-pill {
  font-family: var(--font-round);
  font-size: clamp(10px, 1vw, 14px);
  line-height: 1.1;
  padding: clamp(4px, 0.6vh, 7px) clamp(12px, 1.4vw, 20px);
  border-radius: 999px;
  border: 2px solid currentColor;
  background: #fff;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, color 0.15s, opacity 0.15s;
}
.p13-pill sup { font-size: 0.7em; }
.p13-pill-general { color: #EE9A33; }
.p13-pill-heim { color: #12A8BA; }
.p13-pill-general.is-active { background: #EE9A33; color: #fff; }
.p13-pill-heim.is-active { background: #12A8BA; color: #fff; }

/* 非選択時はヘッダーバー（p13-gen-head / p13-headbar）は常時表示し、内訳テーブル・サイドバーのみ非表示 */
.p13-panel.is-hidden .p13-table,
.p13-panel.is-hidden .p13-gen-side {
  visibility: hidden;
}

.p13-compare {
  flex: 0 1 auto;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(14px, 2vw, 32px);
  margin-top: clamp(2px, 0.6vh, 8px);
}

/* 幅比 = アスペクト比の比（1821:1106 と 1483:1106）に合わせ、左右パネルを等高に揃える
   → 内訳バー・リフォーム費用タグ・各行が左右で水平に揃う */
.p13-panel {
  position: relative;
  height: auto;
}
.p13-panel-general { flex: 0 1 54%; aspect-ratio: 1821 / 1106; }
.p13-panel-heim    { flex: 0 1 44%; aspect-ratio: 1483 / 1106; }

.p13-panel img {
  position: absolute;
  display: block;
}

/* 左：内訳テーブル（土台）＋ 左サイドバー ＋ ヘッダーバー（重ね） */
.p13-panel-general .p13-table {
  left: 18.56%; top: 0; width: 81.44%; height: auto; z-index: 2;
}
.p13-panel-general .p13-gen-side {
  left: 0; top: 23.23%; width: 17.52%; height: auto; z-index: 1;
}
.p13-panel-general .p13-gen-head {
  left: 18.56%; top: 5.51%; width: 81.44%; height: auto; z-index: 1;
}

/* 右：内訳テーブル（土台）＋ ヘッダーバー（重ね） */
.p13-panel-heim .p13-table {
  left: 0; top: 0; width: 100%; height: auto; z-index:1;
}
.p13-panel-heim .p13-headbar {
  left: 0; top: 5.51%; width: 100%; height: auto;
}

.p13-note {
  flex: 0 0 auto;
  margin-top: clamp(8px, 1.4vh, 18px);
}

/* ============================================================
   P14 / P15 価値ページ（図版1枚）
   ============================================================ */
.value-page-figure {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 8px 0;
}
.value-page-figure img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* ============================================================
   P11 プレースホルダー
   ============================================================ */
.p11-placeholder {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  background: #fff;
  border-radius: 20px;
  font-size: 18px;
  color: #aaa;
  margin: 0 0 16px 0;
}

/* ============================================================
   Color Utilities
   ============================================================ */
.c-teal   { color: #00B5AD; }
.c-green  { color: #5CB85C; }
.c-pink   { color: #E91E8C; }
.c-purple { color: #9C27B0; }
.c-orange { color: #F5A623; }
.c-red    { color: #c00; }
.c-blue   { color: #2196F3; }

.bg-teal   { background: #01AEBE; }
.bg-green  { background: #6BBB5A; }
.bg-pink   { background: #E85780; }
.bg-purple { background: #9C27B0; }
.bg-orange { background: #F5A623; }

.border-teal   { border-color: #00B5AD; }
.border-green  { border-color: #5CB85C; }
.border-pink   { border-color: #E91E8C; }
.border-purple { border-color: #9C27B0; }
.border-orange { border-color: #F5A623; }

/* ============================================================
   Utility
   ============================================================ */
.flex-col { display: flex; flex-direction: column; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.text-sm { font-size: 11px; }
.font-bold { font-weight: 700; }
.text-center { text-align: center; }

/* ============================================================
   Chart.js canvas positioning (requires maintainAspectRatio: false)
   ============================================================ */
.p6-chart-wrap canvas,
.p7-chart-wrap canvas,
.maintenance-chart-wrap canvas,
.p12-chart-wrap canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100% !important;
  height: 100% !important;
}
/* Ensure wrappers have a non-zero height for Chart.js */
.p6-chart-wrap,
.p7-chart-wrap,
.maintenance-chart-wrap,
.p12-chart-wrap {
  min-height: 150px;
}

/* ============================================================
   Responsive scale (viewport-based)
   ============================================================ */
@media (max-width: 1200px) {
  .page-title { font-size: 30px; margin-top:50px; margin-bottom: 40px; }
  .home-card-label {  padding: 24px 16px; }
}
@media (max-width: 900px) {
  .sidebar { width: 50px; }
  .page-inner { padding-right: 62px; }
  .nav-circle { width: 40px; height: 40px; }
}
