/* ============================================================
   スマート家計簿 サポートサイト共通スタイル
   デジタル庁デザインシステム v2.17.0 準拠（lp.css と同じ設計）
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;700&display=swap");

:root {
  --blue-50: rgb(234, 239, 255);
  --blue-100: rgb(217, 227, 255);
  --blue-900: rgb(0, 23, 193);
  --blue-1000: rgb(0, 17, 143);
  --blue-1200: rgb(0, 0, 96);
  --white: #ffffff;
  --gray-50: rgb(247, 247, 247);
  --gray-200: rgb(214, 214, 214);
  --gray-420: rgb(148, 148, 148);
  --gray-600: rgb(115, 115, 115);
  --gray-800: rgb(51, 51, 51);
  --gray-900: rgb(28, 28, 28);
  --yellow-300: rgb(255, 212, 61);
  --red-800: rgb(197, 0, 0);
  --green-800: rgb(0, 122, 51);

  --text-body: var(--gray-800);
  --text-strong: var(--gray-900);
  --text-muted: var(--gray-600);
  --text-link: var(--blue-900);
  --surface-page: var(--white);
  --surface-subtle: var(--gray-50);
  --surface-accent-subtle: var(--blue-50);
  --surface-key: var(--blue-1000);
  --border-default: var(--gray-420);
  --border-subtle: var(--gray-200);

  --font-sans: "Noto Sans JP", sans-serif;
  --shell: 1120px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: 0.02em;
  color: var(--text-body);
  background: var(--surface-page);
}

img {
  max-width: 100%;
}

a {
  color: var(--text-link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--blue-1000);
}

a:active {
  color: var(--blue-1200);
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 4px solid #000;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--yellow-300);
  border-radius: 2px;
}

/* --- ヘッダー（HeaderContainer 相当） --- */
.site-header {
  border-bottom: 1px solid var(--border-default);
  background: var(--surface-page);
}

.site-header-inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text-strong);
  text-decoration: none;
}

.site-brand:hover {
  color: var(--text-strong);
  text-decoration: underline;
}

.site-brand img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
  display: block;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
}

.site-nav a {
  font-size: 16px;
  line-height: 1.5;
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover {
  text-decoration: underline;
}

.site-nav a[aria-current="page"] {
  color: var(--text-strong);
  font-weight: 700;
  border-bottom-color: var(--surface-key);
}

/* --- ページ骨格（既存マークアップの器をそのまま使う） --- */
.app-shell,
.main-content {
  display: block;
}

.content-inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 32px 32px 80px;
}

/* --- パンくず --- */
.breadcrumb {
  margin: 0 0 24px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--text-link);
}

/* --- ページ見出し --- */
.page-header {
  padding: 0 0 32px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 40px;
}

.page-header .eyebrow {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-link);
}

.page-header h1 {
  margin: 0 0 16px;
  font-size: 36px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.01em;
  color: var(--text-strong);
}

.page-header p {
  margin: 0;
  max-width: 720px;
  font-size: 17px;
  text-wrap: pretty;
}

/* --- ホームのファーストビュー（テキスト＋画面キャプチャの2カラム） --- */
.home-hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: center;
}

.home-hero .page-header {
  padding: 0;
  border-bottom: 0;
  margin-bottom: 0;
}

.home-shot {
  width: 100%;
  max-width: 260px;
  border: 1px solid var(--border-default);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface-page);
  justify-self: center;
}

.home-shot img {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 18;
  object-fit: cover;
  object-position: top center;
}

/* --- 機能チップ列 --- */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface-accent-subtle);
  color: var(--text-link);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

/* --- 見出し（本文中） --- */
h2 {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--text-strong);
  border-left: 8px solid var(--surface-key);
  padding-left: 16px;
  margin: 0 0 16px;
}

h3 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text-strong);
  margin: 32px 0 8px;
}

p {
  text-wrap: pretty;
}

section.section-block,
section.manual-section,
section.article-section,
section.faq-group {
  margin: 0 0 48px;
}

.article-lead {
  border: 1px solid var(--border-default);
  border-left: 4px solid var(--blue-900);
  border-radius: 0 12px 12px 0;
  padding: 20px 24px;
  margin: 0 0 40px;
  background: var(--surface-page);
  font-size: 16px;
}

.article-lead p {
  margin: 0;
}

/* --- コーヒー代シミュレーション --- */
.coffee-simulator {
  border: 1px solid var(--border-default);
  border-radius: 16px;
  padding: 28px;
  background: var(--surface-page);
}

.simulator-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 24px;
  padding: 24px;
  border-radius: 12px;
  background: var(--surface-subtle);
}

.simulator-control {
  display: grid;
  gap: 8px;
}

.simulator-control label,
.simulator-people legend {
  font-weight: 700;
  color: var(--text-strong);
}

.simulator-value {
  font-weight: 400;
  color: var(--text-muted);
}

.simulator-control input[type="range"] {
  width: 100%;
  accent-color: var(--blue-900);
}

.simulator-help {
  font-size: 14px;
  color: var(--text-muted);
}

.simulator-people {
  margin: 0;
  padding: 0;
  border: 0;
}

.simulator-radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: 8px;
}

.simulator-radio-row label {
  font-weight: 400;
  color: var(--text-body);
}

.simulator-results {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 24px 0;
}

.simulator-result {
  padding: 20px;
  border-radius: 12px;
  background: var(--blue-50);
  text-align: center;
}

.simulator-result h3 {
  margin: 0 0 8px;
  font-size: 15px;
  color: var(--text-muted);
}

.simulator-result p {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  color: var(--text-strong);
}

.simulator-chart-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 16px;
}

.simulator-chart {
  display: block;
  width: 100%;
  min-width: 560px;
  height: 320px;
}

.simulator-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin: 16px 0 0;
  font-size: 14px;
}

.simulator-legend span::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 3px;
  margin: 0 7px 3px 0;
  vertical-align: middle;
  background: var(--gray-600);
}

.simulator-legend .legend-home::before {
  background: var(--blue-900);
}

.affiliate-recommendation {
  margin-top: 24px;
  padding: 24px;
  border: 1px solid var(--border-default);
  border-radius: 12px;
  background: var(--surface-subtle);
}

.affiliate-recommendation h3 {
  margin-top: 0;
}

.affiliate-recommendation p {
  margin: 0 0 16px;
}

/* --- ボタン --- */
.da-btn,
.contact-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 32px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  text-decoration: none;
  background: var(--blue-900);
  color: var(--white);
  transition: background-color 120ms ease-out;
}

.da-btn:hover,
.contact-button:hover {
  background: var(--blue-1000);
  color: var(--white);
}

.da-btn:active,
.contact-button:active {
  background: var(--blue-1200);
}

.da-btn--outlined {
  background: var(--white);
  color: var(--blue-900);
  box-shadow: inset 0 0 0 1px var(--blue-900);
}

.da-btn--outlined:hover {
  background: var(--blue-50);
  color: var(--blue-1000);
}

/* --- カードグリッド（Card 相当） --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 0 0 48px;
}

.link-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--border-default);
  border-radius: 16px;
  padding: 28px;
  background: var(--surface-page);
  color: var(--text-body);
  text-decoration: none;
  transition: background-color 120ms ease-out;
}

.link-card:hover {
  background: var(--surface-subtle);
  color: var(--text-body);
}

.link-card .card-icon {
  display: none;
}

.link-card h3 {
  margin: 0;
  font-size: 20px;
}

.link-card p {
  margin: 0;
  font-size: 16px;
}

.link-card .card-cta {
  margin-top: 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* --- 一覧・リスト --- */
ul.checklist,
ol.steps,
ol.step-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  border: 1px solid var(--border-default);
  border-radius: 16px;
  overflow: hidden;
  counter-reset: da-step;
}

ul.checklist li,
ol.step-list li {
  display: flex;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 16px;
}

ol.steps li {
  display: block;
  position: relative;
  padding: 20px 24px 20px 68px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 16px;
}

ul.checklist li:last-child,
ol.steps li:last-child,
ol.step-list li:last-child {
  border-bottom: 0;
}

.check-icon {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 5px;
  border-radius: 4px;
  background: var(--surface-key);
  position: relative;
  font-size: 0;
  color: transparent;
}

.check-icon::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 4px;
  width: 6px;
  height: 10px;
  border-right: 2px solid var(--white);
  border-bottom: 2px solid var(--white);
  transform: rotate(45deg);
}

ol.steps li,
ol.step-list li {
  counter-increment: da-step;
}

ol.steps li::before {
  content: counter(da-step);
  position: absolute;
  left: 24px;
  top: 20px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: var(--surface-key);
  color: var(--white);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

ol.step-list li:not(:has(.step-num))::before {
  content: counter(da-step);
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: var(--surface-key);
  color: var(--white);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.step-num {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: var(--surface-key);
  color: var(--white);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

ul.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

ul.news-list li {
  padding: 20px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.empty-placeholder {
  border: 1px solid var(--border-default);
  border-radius: 12px;
  padding: 24px;
  background: var(--surface-subtle);
  font-size: 16px;
  color: var(--text-muted);
}

/* --- 目次（TableOfContents 相当） --- */
.manual-toc {
  border: 1px solid var(--border-default);
  border-radius: 16px;
  padding: 24px 28px;
  margin: 0 0 48px;
  background: var(--surface-subtle);
}

.manual-toc-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-strong);
  margin-bottom: 12px;
}

.manual-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.manual-toc a {
  font-size: 16px;
}

/* --- 注釈（NoticeBlock 相当） --- */
.callout {
  border: 1px solid var(--border-default);
  border-left: 4px solid var(--blue-900);
  border-radius: 0 12px 12px 0;
  padding: 20px 24px;
  margin: 24px 0 0;
  background: var(--surface-page);
  font-size: 16px;
}

.callout.tip {
  border-left-color: var(--green-800);
}

.callout.warn,
.callout.caution {
  border-left-color: var(--red-800);
}

kbd {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  border: 1px solid var(--border-default);
  border-radius: 4px;
  padding: 3px 6px;
  background: var(--surface-subtle);
  color: var(--text-strong);
}

/* --- テーブル（Table 相当） --- */
.table-wrap {
  margin: 24px 0 0;
  overflow-x: auto;
  border: 1px solid var(--border-default);
  border-radius: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

th {
  background: var(--surface-subtle);
  font-weight: 700;
  color: var(--text-strong);
  white-space: nowrap;
}

tr:last-child th,
tr:last-child td {
  border-bottom: 0;
}

/* --- FAQ（Accordion 相当） --- */
.faq-group > h2 {
  margin-bottom: 16px;
}

details.faq-item {
  border: 1px solid var(--border-default);
  border-radius: 12px;
  margin-bottom: 12px;
  background: var(--surface-page);
}

details.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 20px 56px 20px 24px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-strong);
  position: relative;
}

details.faq-item summary::-webkit-details-marker {
  display: none;
}

details.faq-item summary::after {
  content: "";
  position: absolute;
  right: 26px;
  top: 28px;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--blue-900);
  border-bottom: 2px solid var(--blue-900);
  transform: rotate(45deg);
  transition: transform 120ms ease-out;
}

details.faq-item[open] summary::after {
  transform: rotate(-135deg);
  top: 32px;
}

details.faq-item summary:hover {
  background: var(--surface-subtle);
  border-radius: 12px;
}

.faq-answer {
  margin: 0;
  padding: 0 24px 24px;
  font-size: 16px;
}

/* --- 前後ページ送り（PageNavigation 相当） --- */
.page-nav {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin: 48px 0 0;
}

.page-nav-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--border-default);
  border-radius: 16px;
  padding: 20px 24px;
  text-decoration: none;
  color: var(--text-body);
  background: var(--surface-page);
}

.page-nav-item:hover {
  background: var(--surface-subtle);
  color: var(--text-body);
}

.page-nav-item span {
  font-size: 14px;
  color: var(--text-muted);
}

.page-nav-item strong {
  font-size: 17px;
  color: var(--text-link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.page-nav-item.next {
  text-align: right;
}

/* --- 広告枠 --- */
.ad-placeholder {
  border: 1px dashed var(--border-default);
  border-radius: 12px;
  padding: 24px;
  margin: 48px 0 0;
  background: var(--surface-subtle);
  color: var(--text-muted);
  font-size: 14px;
}

.ad-placeholder p {
  margin: 4px 0 0;
}

.ad-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* --- プレミアム機能ショーケース --- */
.plan-table td.is-yes {
  color: var(--text-body);
}

.plan-table td.is-premium {
  color: var(--text-link);
  font-weight: 700;
}

.premium-feature {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
  padding: 40px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.premium-feature:first-child {
  padding-top: 8px;
}

.premium-feature:last-child {
  border-bottom: 0;
  padding-bottom: 8px;
}

.premium-feature.is-reverse .premium-feature-shot {
  order: -1;
}

.premium-feature.is-text-only {
  grid-template-columns: 1fr;
}

.premium-feature-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--surface-accent-subtle);
  color: var(--text-link);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
}

.premium-feature-body h3 {
  margin: 0 0 12px;
  font-size: 22px;
}

.premium-feature-body p {
  margin: 0 0 10px;
  font-size: 16px;
}

.premium-feature-body ul {
  margin: 12px 0 0;
  padding-left: 20px;
  font-size: 16px;
}

.premium-feature-body li {
  margin: 0 0 6px;
}

.premium-feature-shot img {
  display: block;
  width: 100%;
  max-width: 280px;
  aspect-ratio: 9 / 18;
  margin: 0 auto;
  border: 1px solid var(--border-default);
  border-radius: 16px;
  object-fit: cover;
  object-position: top center;
  background: var(--surface-page);
}

.shot-placeholder {
  aspect-ratio: 9 / 18;
  max-width: 280px;
  margin: 0 auto;
  border: 1px dashed var(--border-default);
  border-radius: 16px;
  background: var(--surface-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
}

.shot-placeholder-inner {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.shot-placeholder-inner strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text-body);
  font-size: 14px;
}

/* --- プライバシーポリシーの諸元 --- */
.policy-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 40px;
  border: 1px solid var(--border-default);
  border-radius: 16px;
  overflow: hidden;
}

.policy-meta > div {
  padding: 20px 24px;
  border-right: 1px solid var(--border-subtle);
}

.policy-meta > div:last-child {
  border-right: 0;
}

.policy-meta dt {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.policy-meta dd {
  margin: 0;
  font-size: 16px;
  color: var(--text-strong);
}

/* --- フッター --- */
.site-footer {
  border-top: 1px solid var(--border-default);
  margin-top: 64px;
  padding: 40px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-muted);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
}

.site-footer nav a {
  font-size: 16px;
}

/* ------------------------------------------------------------
   レスポンシブ
   ------------------------------------------------------------ */

@media (max-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .site-header-inner,
  .content-inner {
    padding-left: 16px;
    padding-right: 16px;
  }

  .site-nav {
    gap: 8px 16px;
    font-size: 14px;
  }

  .page-header h1 {
    font-size: 28px;
  }

  .home-hero {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .home-hero .home-shot {
    order: -1;
    max-width: 200px;
  }

  h2 {
    font-size: 24px;
  }

  .card-grid,
  .page-nav,
  .policy-meta,
  .simulator-controls,
  .simulator-results {
    grid-template-columns: 1fr;
  }

  .coffee-simulator {
    padding: 16px;
  }

  .simulator-controls {
    padding: 16px;
  }

  .premium-feature {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 32px 0;
  }

  .premium-feature-shot {
    order: -1;
  }

  .policy-meta > div {
    border-right: 0;
    border-bottom: 1px solid var(--border-subtle);
  }

  .policy-meta > div:last-child {
    border-bottom: 0;
  }

  .page-nav-item.next {
    text-align: left;
  }

  .contact-button,
  .da-btn {
    width: 100%;
  }
}
