/*
  トップページ専用スタイル（新TOP案）
  style.css は他ページと共有のため、トップ固有の要素はここに置く
*/

/* ===================== NAV CTA ===================== */
.nav-actions { display: flex; gap: 8px; }
.btn-nav--primary {
  background: var(--dark);
  color: var(--white);
}
.btn-nav--primary:hover { background: #1f2937; }

/* ===================== HERO ===================== */
/* 日本語の見出しをフレーズ単位でのみ折り返す */
.hero-copy { container-type: inline-size; }
/* 「診断だけでは終わらない。」(12字) が1行に収まる大きさ */
.hero-title { font-size: clamp(1.25rem, 7.9cqi, 3rem); line-height: 1.25; }
.hero-title .phrase { display: inline-block; white-space: nowrap; }
.hero-desc .phrase { display: inline-block; }
.hero-title .hero-title-sub {
  display: block;
  margin-top: 0.4em;
  font-size: 0.6em;
  line-height: 1.45;
}
.hero-title .hero-title-sub::after { display: none; }
.hero-subcta {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--dark-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.hero-subcta:hover { color: var(--dark); }

/* ===================== INLINE CTA（各セクション末） ===================== */
.inline-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 20px;
  margin-top: 48px;
}
.inline-cta__link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--dark-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.inline-cta__link:hover { color: var(--dark); }
.section-yellow .inline-cta__link { color: var(--dark); }

/* ===================== PROBLEMS ===================== */
/* 次の #mechanism（グレー背景）へなだらかにつなぐ */
#problems { background: linear-gradient(180deg, var(--white) 0%, var(--gray-light) 100%); }
.problems-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.problem-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px 30px;
  box-shadow: var(--shadow-sm);
}
.problem-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--yellow) 0%, var(--yellow-hover) 100%);
}
.problem-card.visible { transition: opacity 0.6s cubic-bezier(0.16,1,0.3,1), transform var(--trans), box-shadow var(--trans), border-color var(--trans); }
.problem-card.visible:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--yellow);
}
.problem-card__head {
  display: flex;
  margin-bottom: 18px;
}
.problem-card__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px 5px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--dark-2);
}
.problem-card__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 22px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--dark);
  color: var(--white);
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}
/* 担当者の「声」を吹き出しで見せる */
.problem-card__voice {
  position: relative;
  margin-bottom: 26px;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--yellow-light);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.6;
}
.problem-card__voice::after {
  content: "";
  position: absolute;
  left: 26px;
  bottom: -10px;
  border-width: 10px 9px 0 0;
  border-style: solid;
  border-color: var(--yellow-light) transparent transparent transparent;
}
/* 見出し・結論は文節の切れ目でだけ折り返す */
.problem-card__voice .phrase { display: inline-block; }
.problem-card__text {
  font-size: 0.88rem;
  color: var(--gray);
  line-height: 1.8;
}
/* ===================== AI MECHANISM ===================== */
.mech-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  grid-template-rows: repeat(4, auto);
  align-items: stretch;
  column-gap: 12px;
}
.mech-step {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 24px 20px;
  /* 各ステップの行（番号・見出し・水色枠・本文）を subgrid でそろえる */
  display: grid;
  grid-row: span 4;
  grid-template-rows: subgrid;
  row-gap: 0;
}

.mech-step__num {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--yellow-hover);
  margin-bottom: 6px;
}
.mech-step h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.mech-step__example {
  font-size: 0.8rem;
  line-height: 1.7;
  background: var(--yellow-light);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  color: var(--dark-2);
}
.mech-step__example ul { list-style: disc; padding-left: 1.1em; }
.mech-step p {
  font-size: 0.82rem;
  color: var(--gray);
  line-height: 1.75;
}
.mech-arrow {
  grid-row: span 4;
  display: flex;
  align-items: center;
  color: var(--yellow-hover);
}
.mech-footnote {
  margin-top: 16px;
  text-align: right;
  font-size: 0.75rem;
  color: var(--gray);
}
.mech-takeaway {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.mech-takeaway__item {
  border-left: 4px solid var(--yellow);
  padding: 4px 0 4px 16px;
}
.mech-takeaway__item h3 { font-size: 0.98rem; font-weight: 700; margin-bottom: 4px; }
.mech-takeaway__item p { font-size: 0.86rem; color: var(--gray); line-height: 1.75; }

/* ===================== FEATURES ===================== */
/* タブは全て同じ幅にそろえる */
/* タブは全て同じ幅にそろえ、表示中のタブ数に関係なく中央ぞろえにする（現在7枚） */
.ftab-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.ftab-nav .ftab-btn { flex: 0 0 calc((100% - 6 * 8px) / 7); padding: 10px 6px; text-align: center; }

/* ===================== MERITS（4枚） ===================== */
/* 左に動画（16:9）、右に1列4行のリスト */
.merits-layout--split {
  grid-template-columns: 1.1fr 1fr;
  gap: 32px;
  align-items: center;
}
/* 紹介動画：音ボタンと章（LP と同じ作り）。左の列は約600px なので章は3列×2段 */
.video-sound {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 0;
  border-radius: var(--radius-pill);
  background: rgba(17,24,39,0.72);
  color: var(--white);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: background var(--trans);
}
.video-sound:hover { background: rgba(17,24,39,0.88); }
.video-sound:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }
.video-sound svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.video-sound .on { display: none; }
.video-sound[aria-pressed="true"] .on { display: inline; }
.video-sound[aria-pressed="true"] .off { display: none; }

.video-ch {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
}
.video-ch__play {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: var(--dark);
  color: var(--white);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background var(--trans), transform var(--trans);
}
.video-ch__play:hover { background: #1f2937; transform: scale(1.05); }
.video-ch__play svg { width: 18px; height: 18px; fill: currentColor; }
.video-ch__play .i-play { display: none; margin-left: 2px; }
.video-ch__play[data-state="paused"] .i-play { display: block; }
.video-ch__play[data-state="paused"] .i-pause { display: none; }
.video-ch__play:focus-visible,
.video-ch__list button:focus-visible { outline: 2px solid var(--yellow-hover); outline-offset: 3px; }
.video-ch__list {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.video-ch__list button {
  display: block;
  width: 100%;
  padding: 4px 0;
  border: 0;
  background: none;
  font: inherit;
  text-align: left;
  color: inherit;
  cursor: pointer;
}
.video-ch__list .bar {
  display: block;
  height: 3px;
  border-radius: 2px;
  background: var(--border);
  overflow: hidden;
}
.video-ch__list .bar i { display: block; width: 0; height: 100%; background: var(--yellow-hover); }
.video-ch__list .lbl {
  display: block;
  margin-top: 7px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--gray);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--trans);
}
.video-ch__list .lbl b {
  margin-right: 6px;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-feature-settings: "tnum";
  color: var(--yellow-hover);
}
.video-ch__list button:hover .lbl,
.video-ch__list .now .lbl { color: var(--dark); }
.video-ch__now { display: none; }
@media (max-width: 600px) {
  .video-sound { right: 8px; bottom: 8px; padding: 6px 11px; font-size: 0.75rem; }
  .video-ch { flex-wrap: wrap; gap: 12px; margin-top: 12px; }
  .video-ch__play { width: 40px; height: 40px; }
  .video-ch__list { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
  .video-ch__list .lbl { margin-top: 6px; font-size: 0.7rem; }
  .video-ch__list .lbl .t { display: none; }
  .video-ch__list .lbl b { margin: 0; }
  .video-ch__now { display: block; flex-basis: 100%; margin: 0; font-size: 0.85rem; font-weight: 600; color: var(--dark-2); }
  .video-ch__now b { margin-right: 6px; color: var(--yellow-hover); }
}

.merits-layout--split .merits-items-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
.merits-layout--split .merit-item,
.merits-layout--split .merit-item:first-child {
  display: grid;
  grid-template-columns: 36px 1fr;
  column-gap: 14px;
  row-gap: 2px;
  align-items: start;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--white);
}
.merit-item-head { display: contents; }
.merits-layout--split .merit-icon-wrap {
  grid-row: span 2;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  margin: 0;
}
.merits-layout--split .merit-icon-wrap svg { width: 22px; height: 22px; }
.merit-item-head h3 { font-size: 0.92rem; font-weight: 700; line-height: 1.45; color: var(--dark); }
.merits-layout--split .merit-item-body p { font-size: 0.8rem; line-height: 1.6; }
.merit-item-body .merit-points {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--dark-2);
  line-height: 1.7;
  list-style: disc;
  padding-left: 1.1em;
}

/* ===================== COMPARE TABLE ===================== */
.compare-wrap {
  max-width: 920px;
  margin: 0 auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.compare-table {
  width: 100%;
  min-width: 560px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
}
.compare-table th,
.compare-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  text-align: center;
  vertical-align: middle;
}
.compare-table thead th {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gray);
  border-bottom: 2px solid var(--border);
}
.compare-table thead th.is-ours {
  color: var(--dark);
  background: var(--yellow-light);
  border-radius: 14px 14px 0 0;
}
.compare-table tbody th {
  text-align: left;
  font-weight: 600;
  color: var(--dark);
}
.compare-table tbody th small {
  display: block;
  font-weight: 400;
  font-size: 0.76rem;
  color: var(--gray);
  margin-top: 2px;
}
.compare-table td.is-ours { background: var(--yellow-light); font-weight: 700; }
.compare-table .group-row th {
  background: var(--gray-light);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--gray);
  padding: 8px 18px;
}
.cmp-mark { font-size: 1.15rem; font-weight: 800; }
.cmp-yes { color: #0891b2; }
.cmp-partial { color: #9CA3AF; }
.cmp-no { color: #D1D5DB; }
.compare-table td small { display: block; font-size: 0.72rem; color: var(--gray); font-weight: 400; }
.compare-footnote {
  max-width: 920px;
  margin: 16px auto 0;
  font-size: 0.75rem;
  color: var(--gray);
}

/* ===================== CREDIT GUIDE ===================== */
.credit-guide {
  max-width: 920px;
  margin: 48px auto 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 28px 24px;
}
.credit-guide h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 6px; }
.credit-guide > p { font-size: 0.86rem; color: var(--gray); line-height: 1.8; margin-bottom: 16px; }
.credit-guide table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.credit-guide th, .credit-guide td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.credit-guide thead th { font-size: 0.78rem; color: var(--gray); font-weight: 600; }
.credit-guide td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.credit-guide td.unit, .credit-guide th.unit { color: var(--gray); white-space: nowrap; font-size: 0.8rem; }
.credit-guide td.num { font-weight: 700; color: var(--dark); }
.credit-guide .group-row th {
  background: var(--gray-light);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--gray);
  padding: 6px 12px;
}
.credit-guide__sub {
  font-size: 0.92rem;
  font-weight: 700;
  margin: 28px 0 10px;
  padding-left: 10px;
  border-left: 4px solid var(--yellow);
}
.credit-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.credit-plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.credit-plan {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--white);
}
.credit-plan__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.credit-plan__name { font-size: 1rem; font-weight: 800; }
.credit-plan__cr { font-size: 0.9rem; font-weight: 700; color: #0891b2; }
.credit-plan__cr small { font-size: 0.72rem; color: var(--gray); font-weight: 500; margin-left: 2px; }
.credit-plan__list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  font-size: 0.78rem;
  line-height: 1.5;
  border-bottom: 1px dashed var(--border);
}
.credit-plan__list li small { display: block; font-size: 0.7rem; color: var(--gray); }
.credit-plan__list li b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.credit-plan__total {
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 10px;
  font-size: 0.85rem;
  font-weight: 700;
}
.credit-plan__bar {
  height: 6px;
  margin: 8px 0 10px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.credit-plan__bar span { display: block; height: 100%; background: var(--yellow-hover); border-radius: inherit; }
.credit-plan__take { margin-top: auto; padding-top: 12px; font-size: 0.76rem; line-height: 1.65; color: var(--dark-2); }
.credit-guide__note { margin-top: 14px; font-size: 0.72rem; line-height: 1.7; color: var(--gray); }

/* ===================== DOCTORS COMMUNITY ===================== */
.doctors-community {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  margin: 24px 0 16px;
  padding: 28px 32px;
  border-radius: var(--radius-lg);
  background: var(--dark);
  color: var(--white);
}
.doctors-community__icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(125,217,237,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--yellow);
}
.doctors-community__tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--yellow);
  margin-bottom: 4px;
}
.doctors-community h3 { font-size: 1.15rem; font-weight: 800; margin-bottom: 6px; }
.doctors-community p { font-size: 0.88rem; line-height: 1.8; color: rgba(255,255,255,0.78); }
.doctors-community__cta {
  display: inline-flex;
  align-items: center;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  background: var(--yellow);
  color: var(--dark);
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
  transition: background var(--trans);
}
.doctors-community__cta:hover { background: var(--yellow-hover); }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1100px) {
  .nav-actions { display: none; } /* style.css と同じくモバイルではナビCTAを隠す */
}
@media (max-width: 980px) {
  .ftab-nav .ftab-btn { flex-basis: calc((100% - 3 * 8px) / 4); }
  .merits-layout--split { grid-template-columns: 1fr; }
  .mech-flow { grid-template-columns: 1fr; grid-template-rows: none; row-gap: 12px; }
  .mech-step { display: flex; flex-direction: column; grid-row: auto; }
  .mech-arrow { grid-row: auto; }
  .mech-arrow { justify-content: center; transform: rotate(90deg); }
  .doctors-community { grid-template-columns: 1fr; text-align: left; }
}
@media (max-width: 900px) {
  .credit-plans { grid-template-columns: 1fr; }
  .problems-grid { grid-template-columns: 1fr; }
  .mech-takeaway { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  /* KV：説明文は文節ごとに改行せず自然に折り返し、縦に伸びすぎないようにする */
  .hero { padding-top: calc(var(--nav-h) + 16px); }
  .hero-badge { margin-bottom: 14px; }
  .hero-title { margin-bottom: 16px; }
  .hero-desc { font-size: 0.9rem; line-height: 1.75; margin-bottom: 24px; text-wrap: pretty; }
  .hero-desc .phrase { display: inline; }
  .hero-copy { padding-bottom: 28px; }
  .problem-card { padding: 26px 22px 24px; }
  .ftab-nav { justify-content: flex-start; }
  .ftab-nav .ftab-btn { flex: 0 0 8.5em; }
  .compare-table { min-width: 0; font-size: 0.8rem; }
  .compare-table th, .compare-table td { padding: 12px 8px; }
  .compare-table thead th { font-size: 0.72rem; }
  .compare-table th[style] { width: auto !important; }
  .credit-guide { padding: 20px 16px; }
  .credit-guide th, .credit-guide td { padding: 8px 6px; font-size: 0.78rem; }
  .credit-details .credit-table-wrap { padding: 0 8px 8px; }
  .doctors-community { padding: 24px 20px; }
}

/* クレジットの目安：機能ごとの表は折りたたみ */
.credit-details { margin-top: 16px; border: 1px solid var(--border); border-radius: var(--radius); }
.credit-details summary {
  cursor: pointer;
  padding: 12px 16px;
  font-size: 0.86rem;
  font-weight: 700;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.credit-details summary::-webkit-details-marker { display: none; }
.credit-details summary::after { content: "＋"; color: var(--gray); }
.credit-details[open] summary::after { content: "−"; }
.credit-details .credit-table-wrap { padding: 0 16px 12px; }
