/* もみほぐしナビ（仮） 単一CSS（モバイルファースト・基準幅375px / タブレット 640px〜 / デスクトップ 1024px〜） */

/* ===== トークン（SITE_SPEC.md §6.2） ===== */
:root {
  --c-primary: #0f766e;
  --c-primary-strong: #115e59;
  --c-primary-pale: #f0fdfa;
  --c-bg: #ffffff;
  --c-text: #1f2937;
  --c-text-muted: #4b5563;
  --c-border: #d1d5db;
  --c-badge-pr-bg: #e5e7eb;
  --c-badge-pr-text: #374151;
  --c-sample-bg: #fef3c7;
  --c-sample-text: #92400e;
  --c-btn-text: #ffffff;
}

/* ===== 最小リセット・ベース ===== */
*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, p, ul, ol, li, table, figure { margin: 0; padding: 0; }
body {
  background: var(--c-bg);
  color: var(--c-text);
  font-family: system-ui, -apple-system, "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-text-size-adjust: 100%;
}
.wrap { max-width: 960px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
a { color: var(--c-primary); }
a:hover { color: var(--c-primary-strong); }
:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }
main { display: block; padding-top: 8px; }
main > section, main > .notes { margin-top: 32px; }
h1 { font-size: 22px; line-height: 1.4; margin-top: 16px; }
h2 { font-size: 19px; line-height: 1.4; margin-bottom: 12px; border-left: 4px solid var(--c-primary); padding-left: 8px; }
h3 { font-size: 16px; margin: 16px 0 8px; }
p { margin-bottom: 12px; }
ul, ol { padding-left: 1.4em; }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.nowrap { white-space: nowrap; }

/* ===== ヘッダー・帯 ===== */
.site-header { border-bottom: 1px solid var(--c-border); }
.site-header .logo {
  display: inline-block; padding: 14px 0; min-height: 44px;
  font-size: 18px; font-weight: 700; color: var(--c-primary-strong); text-decoration: none;
}
.band-pr { background: #f9fafb; border-bottom: 1px solid var(--c-border); }
.band-pr p { margin: 0; padding: 6px 0; font-size: 13px; color: var(--c-text-muted); }
.band-pr a { color: var(--c-text-muted); }
.band-sample { background: var(--c-sample-bg); color: var(--c-sample-text); text-align: center; padding: 10px 0; }
.band-sample strong { display: block; font-size: 15px; }
.band-sample small { display: block; font-size: 12px; font-weight: 400; }

/* ===== パンくず ===== */
.breadcrumb { font-size: 13px; color: var(--c-text-muted); }
.breadcrumb ol { display: flex; flex-wrap: wrap; list-style: none; padding: 12px 0 0; }
.breadcrumb li + li::before { content: "›"; margin: 0 6px; color: var(--c-text-muted); }

/* ===== 本文パーツ ===== */
.lead { font-size: 15px; }
.station-meta { font-size: 13px; color: var(--c-text-muted); margin-bottom: 8px; }
.notice {
  background: var(--c-primary-pale); border: 1px solid var(--c-border); border-radius: 6px;
  padding: 10px 12px; font-size: 13px; color: var(--c-text);
}
.steps li { margin-bottom: 6px; }

/* ===== 比較表 ===== */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
.table-scroll table { min-width: 640px; }
.table-menus table { min-width: 0; }
caption { text-align: left; font-size: 13px; color: var(--c-text-muted); }
th, td { border: 1px solid var(--c-border); padding: 8px 10px; text-align: left; vertical-align: top; }
thead th { background: var(--c-primary-pale); font-size: 13px; }
tbody th[scope="row"] { font-weight: 700; background: #ffffff; }
tbody tr:nth-child(even) { background: var(--c-primary-pale); }
tbody tr:nth-child(even) th[scope="row"] { background: var(--c-primary-pale); }

/* ===== 予約ボタン（アフィリンク）とPRバッジ ===== */
.btn-reserve {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 10px 14px;
  background: var(--c-primary); color: var(--c-btn-text);
  border-radius: 6px; font-weight: 700; font-size: 14px;
  text-decoration: none; white-space: nowrap;
}
.btn-reserve:hover { background: var(--c-primary-strong); color: var(--c-btn-text); }
.btn-reserve span {
  background: var(--c-badge-pr-bg); color: var(--c-badge-pr-text);
  font-size: 11px; font-weight: 700; border-radius: 3px; padding: 1px 5px;
}
.btn-disabled {
  display: inline-flex; align-items: center; min-height: 44px; padding: 10px 14px;
  border: 1px solid var(--c-border); border-radius: 6px;
  color: var(--c-text-muted); font-size: 14px; white-space: nowrap;
}

/* ===== 実データモード部品（公式表記の料金注記・公式サイトリンク） ===== */
.price-note { display: block; font-size: 11px; font-weight: 400; color: var(--c-text-muted); }
.table-note { margin-top: 8px; font-size: 12px; color: var(--c-text-muted); }
.link-official { display: inline-block; padding: 10px 0; min-height: 24px; font-size: 14px; white-space: nowrap; }

/* ===== 店舗サムネイル・サロン詳細ページ（実データモード） ===== */
.shop { display: flex; align-items: center; gap: 8px; }
.shop img { width: 48px; height: 32px; border-radius: 4px; flex: none; }
.aud-note { flex: none; font-size: 11px; color: var(--c-badge-pr-text); background: var(--c-badge-pr-bg); border-radius: 4px; padding: 2px 6px; white-space: nowrap; }
.salon-visual {
  display: block; width: 100%; max-width: 480px; height: auto;
  border: 1px solid var(--c-border); border-radius: 8px; margin: 12px 0 4px;
}
/* 直リンク画像（imageHotlink・SITE_SPEC §9.7.3）: object-fit: contain でトリミング禁止（cover・切り抜き不可）。
   背景のジャンル淡色は <img> の style 属性で指定（ここでは既定値のみ） */
.img-hotlink { object-fit: contain; background: var(--c-primary-pale); }
.salon-visual.img-hotlink { aspect-ratio: 3 / 2; }
.img-credit { margin: 0 0 12px; font-size: 12px; color: var(--c-text-muted); }
table.info-table th[scope="row"] { width: 8.5em; background: var(--c-primary-pale); }
.salon-cta { margin-top: 16px; }
.map-link a { display: inline-block; padding: 8px 0; min-height: 28px; }
table.info-table a[href^="tel:"] { display: inline-block; padding: 8px 0; }
.btn-official {
  display: inline-flex; align-items: center; min-height: 44px; padding: 10px 16px;
  border: 2px solid var(--c-primary); border-radius: 6px;
  color: var(--c-primary); font-weight: 700; font-size: 14px;
  text-decoration: none; white-space: nowrap;
}
.btn-official:hover { background: var(--c-primary-pale); color: var(--c-primary-strong); }

/* ===== 自宅ケアグッズ枠（楽天・SITE_SPEC §9.10） ===== */
/* B方式: 比較表直下のインライン枠。広告と一目でわかる囲み＝薄い背景＋左上PRラベル */
.goods-inline {
  position: relative; margin-top: 16px; padding: 30px 12px 12px;
  background: #f9fafb; border: 1px solid var(--c-border); border-radius: 8px;
}
.pr-label {
  position: absolute; top: 0; left: 0;
  background: var(--c-badge-pr-bg); color: var(--c-badge-pr-text);
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 7px 0 7px 0;
}
.goods-inline-lead { margin: 0 0 8px; font-size: 12px; color: var(--c-text-muted); }
/* A/D方式: カード列（モバイルは横スクロール可） */
.goods-cards {
  display: flex; gap: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}
.goods-card {
  flex: 0 0 170px; display: flex; flex-direction: column; gap: 4px;
  border: 1px solid var(--c-border); border-radius: 8px; padding: 10px; background: #ffffff;
}
.goods-card img { width: 120px; height: 120px; object-fit: contain; margin: 0 auto; background: #ffffff; border-radius: 4px; }
.goods-cards--inline { overflow-x: visible; flex-wrap: wrap; }
.goods-card--compact { flex: 1 1 200px; min-width: 0; }
.goods-card--compact img { width: 80px; height: 80px; }
.goods-name { font-size: 12px; line-height: 1.5; margin: 0; }
.goods-price { font-size: 14px; font-weight: 700; margin: 0; }
.goods-review { font-size: 12px; color: var(--c-text-muted); margin: 0; }
.goods-card .btn-goods { margin-top: auto; }
.btn-goods {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 8px 10px;
  background: var(--c-primary); color: var(--c-btn-text);
  border-radius: 6px; font-weight: 700; font-size: 13px;
  text-decoration: none; white-space: nowrap;
}
.btn-goods:hover { background: var(--c-primary-strong); color: var(--c-btn-text); }
.btn-goods span {
  background: var(--c-badge-pr-bg); color: var(--c-badge-pr-text);
  font-size: 11px; font-weight: 700; border-radius: 3px; padding: 1px 5px;
}
.goods-note { margin-top: 8px; font-size: 12px; color: var(--c-text-muted); }

/* ===== 出張マッサージ枠（駅ハブのみ・SITE_SPEC §9.11） ===== */
.visiting-cards { display: grid; grid-template-columns: 1fr; gap: 12px; }
.visiting-card { border: 1px solid var(--c-border); border-radius: 8px; padding: 14px 16px; }
.visiting-card h3 { margin: 0 0 6px; }
.visiting-info { list-style: none; padding: 0; font-size: 14px; }
.visiting-info li { margin-bottom: 2px; }
.visiting-tags { font-size: 12px; color: var(--c-text-muted); margin: 6px 0 2px; }

/* ===== 駅チップ ===== */
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin-bottom: 8px; }
.chips a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px;
  border: 1px solid var(--c-border); border-radius: 8px;
  text-decoration: none; font-size: 14px;
}
.chips a:hover { border-color: var(--c-primary); background: var(--c-primary-pale); }

/* ===== エリアマップ（トップ「エリアから駅を選ぶ」・SITE_SPEC §9.14・§9.16） ===== */
.map-note { font-size: 13px; color: var(--c-text-muted); max-width: 34em; margin: 0 auto 10px; text-align: center; }
/* 都道府県タイル（12列×12行・大きさ均等／位置関係のみ実際の配置に対応。SITE_SPEC §9.17） */
.jp-map {
  display: none; grid-template: repeat(12, 1fr) / repeat(12, 1fr); align-items: stretch;
  width: min(620px, 100%); aspect-ratio: 1 / 1; gap: 4px; margin: 0 auto 20px;
}
/* 地方タイル（狭い画面用）。背景 = assets/jp-map.svg（列島シルエット。箱の縦横比をSVGに合わせているため歪まない） */
.jp-map-regions {
  position: relative; display: grid; margin: 0 auto 20px; align-items: center; aspect-ratio: 1000 / 1143;
  grid-template: repeat(6, 1fr) / repeat(5, 1fr); width: min(320px, 100%); gap: 3px; padding: 6px;
  background: #e9f3f7 url("jp-map.svg") center / 100% 100% no-repeat;
  border: 1px solid var(--c-border); border-radius: 10px;
}
.jp-cell {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  border: 1px solid var(--c-border); border-radius: 8px; background: rgba(255, 255, 255, 0.92);
  color: var(--c-text); text-decoration: none; text-align: center;
  font-size: 12px; line-height: 1.15; padding: 2px 1px; min-height: 32px; overflow: hidden;
}
.jp-map-regions .jp-cell { font-size: 12px; border-radius: 6px; min-height: 40px; }
.jp-cell .jp-n { font-size: 10px; color: var(--c-text-muted); }
.jp-map .jp-cell { font-size: 13px; }
.jp-cell.lv1 { background: #e4f6f2; border-color: #a7e3da; }
.jp-cell.lv2 { background: #bbe8df; border-color: #6fd2c2; }
.jp-cell.lv3 { background: #6fd0c1; border-color: #35b5a2; }
.jp-cell.lv4 { background: var(--c-primary); border-color: var(--c-primary-strong); color: #fff; }
.jp-cell.lv4 .jp-n { color: rgba(255, 255, 255, 0.85); }
.jp-cell.is-empty { background: #f1f4f6; border-style: dashed; color: #9aa6ad; }
a.jp-cell:hover { outline: 2px solid var(--c-primary-strong); outline-offset: -2px; }
/* 色の凡例 */
.jp-legend {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 4px 12px; font-size: 12px; color: var(--c-text-muted); margin: -8px 0 4px;
}
.jp-sw { width: 14px; height: 14px; margin-right: 2px; border: 1px solid var(--c-border); border-radius: 4px; }
.jp-sw.lv1 { background: #e4f6f2; border-color: #a7e3da; }
.jp-sw.lv2 { background: #bbe8df; border-color: #6fd2c2; }
.jp-sw.lv3 { background: #6fd0c1; border-color: #35b5a2; }
.jp-sw.lv4 { background: var(--c-primary); border-color: var(--c-primary-strong); }
.jp-sw.is-empty { background: #f1f4f6; border-style: dashed; }

/* ===== エリア一覧（地図のリンク先。地方 > 都道府県 > 駅チップ。省スペース配置） ===== */
.area-group > h3 {
  font-size: 15px; margin: 14px 0 4px; padding-bottom: 2px;
  border-bottom: 1px solid var(--c-border); break-after: avoid;
}
.area-group:first-child > h3 { margin-top: 4px; }
/* 県名は行頭のラベルにして1行節約（狭い画面では上に積む） */
.pref-block { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
.pref-block h4 { flex: 0 0 auto; font-size: 13px; font-weight: 700; margin: 4px 0 2px; color: var(--c-text-muted); }
.pref-block .chips { flex: 1 1 200px; margin-bottom: 2px; gap: 4px 6px; }
.pref-n { font-size: 11px; font-weight: 400; margin-left: 3px; }
.area-group, .pref-block { scroll-margin-top: 12px; }

/* ===== 誘導カード ===== */
.cards { display: grid; grid-template-columns: 1fr; gap: 12px; }
.card {
  display: block; border: 1px solid var(--c-border); border-radius: 8px;
  padding: 16px; text-decoration: none; color: inherit;
}
.card strong { display: block; color: var(--c-primary); font-size: 15px; }
a.card:hover { border-color: var(--c-primary); background: var(--c-primary-pale); }
.card .num { display: block; font-size: 20px; font-weight: 700; color: var(--c-primary-strong); margin: 4px 0; }
.card .sub { display: block; font-size: 12px; color: var(--c-text-muted); }
.card--plain strong { color: var(--c-text-muted); }

/* ===== FAQ ===== */
details.faq { border: 1px solid var(--c-border); border-radius: 8px; margin-bottom: 10px; }
details.faq summary {
  padding: 12px 14px; min-height: 44px; font-weight: 700; font-size: 14px; cursor: pointer;
}
details.faq summary:focus-visible { outline: 2px solid var(--c-primary); outline-offset: -2px; }
.faq-a { padding: 0 14px 12px; font-size: 14px; }

/* ===== 関連リンク・注記 ===== */
.rel-links { list-style: none; padding: 0; }
.rel-links li { margin-bottom: 8px; }
.rel-links a { display: inline-block; padding: 8px 0; min-height: 28px; }
.notes { border-top: 1px solid var(--c-border); margin-top: 40px; padding-top: 12px; }
.notes ul { list-style: none; padding: 0; }
.notes li { font-size: 13px; color: var(--c-text-muted); margin-bottom: 4px; }

/* ===== 法務ページ（prose） ===== */
.prose h1 { margin-bottom: 12px; }
.prose h2 { margin-top: 28px; }
.prose h3 { margin-top: 20px; }
.prose table { font-size: 14px; margin-bottom: 12px; }
.prose ul { margin-bottom: 12px; }
.prose blockquote {
  border-left: 4px solid var(--c-border); padding-left: 12px; margin: 12px 0;
  color: var(--c-text-muted);
}

/* ===== フッター ===== */
.site-footer { margin-top: 48px; background: #f9fafb; border-top: 1px solid var(--c-border); padding: 24px 0; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 4px 16px; list-style: none; padding: 0; }
.site-footer a { display: inline-block; padding: 8px 0; font-size: 13px; }
.copyright { margin: 12px 0 0; font-size: 12px; color: var(--c-text-muted); }

/* ===== モバイル（〜639px）: 比較表のカード表示・広告B枠コンパクト・CTA全幅 ===== */
@media (max-width: 639px) {
  /* 比較表は1店舗＝1カードの縦積み（列見出しは td の data-label で再掲・thead は視覚的に隠す） */
  .table-compare { overflow-x: visible; }
  .table-compare table { min-width: 0; display: block; border: 0; }
  .table-compare thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table-compare tbody { display: block; }
  .table-compare tbody tr {
    display: block; border: 1px solid var(--c-border); border-radius: 8px;
    padding: 4px 0 10px; margin-bottom: 12px;
  }
  .table-compare th[scope="row"], .table-compare td { display: block; border: 0; padding: 4px 12px; }
  .table-compare th[scope="row"] {
    font-size: 15px; padding: 10px 12px 8px;
    border-bottom: 1px solid var(--c-border); margin-bottom: 6px;
  }
  .table-compare td { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
  .table-compare td::before {
    content: attr(data-label); flex: 0 0 4.5em;
    font-size: 12px; font-weight: 700; color: var(--c-text-muted);
  }
  .table-compare td > .price-note { flex: 1 0 100%; padding-left: calc(4.5em + 8px); }
  .table-compare td.nowrap { white-space: normal; }
  .table-compare td:empty { display: none; }
  .table-compare td:last-child { display: block; padding-top: 8px; }
  .table-compare td:last-child::before { display: none; }
  .table-compare .btn-reserve, .table-compare .btn-disabled { display: flex; width: 100%; justify-content: center; }
  .table-compare .link-official {
    display: flex; align-items: center; justify-content: center; width: 100%;
    min-height: 44px; padding: 10px 14px;
    border: 1px solid var(--c-border); border-radius: 6px;
  }
  /* B枠（比較表直下の広告）: 商品1列・画像左の横組みコンパクト表示 */
  .goods-cards--inline { gap: 8px; }
  .goods-card--compact {
    flex: 1 1 100%; display: grid; grid-template-columns: 64px 1fr;
    column-gap: 10px; row-gap: 2px; align-items: center;
  }
  .goods-card--compact img { grid-row: 1 / 4; width: 64px; height: 64px; margin: 0; }
  .goods-card--compact .btn-goods { margin-top: 4px; justify-self: start; }
  /* 詳細ページCTA: 全幅で押しやすく */
  .salon-cta .btn-reserve, .salon-cta .btn-official { display: flex; width: 100%; justify-content: center; }
}

/* ===== タブレット（min-width: 640px） ===== */
@media (min-width: 640px) {
  .wrap { padding-left: 24px; padding-right: 24px; }
  h1 { font-size: 28px; }
  h2 { font-size: 22px; }
  main > section, main > .notes { margin-top: 40px; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .visiting-cards { grid-template-columns: repeat(2, 1fr); }
  /* グッズA/D枠: 横スクロールをやめて2列グリッド */
  .goods-cards:not(.goods-cards--inline) {
    display: grid; grid-template-columns: repeat(2, 1fr); overflow-x: visible;
  }
  .goods-cards:not(.goods-cards--inline) .goods-card { flex: none; width: auto; }
  .band-sample strong { display: inline; margin-right: 8px; }
  .band-sample small { display: inline; }
  /* トップ: 都道府県タイルに切り替え、地方タイルは隠す */
  .jp-map { display: grid; }
  .jp-map-regions { display: none; }
  /* 駅一覧: チップを小型化して縦を詰める（タップ主体のモバイルは44pxを維持）。並びは1列 */
  .chips a { min-height: 32px; padding: 5px 10px; font-size: 13px; }
}

/* ===== デスクトップ（min-width: 1024px） ===== */
@media (min-width: 1024px) {
  .wrap { max-width: 1100px; padding-left: 32px; padding-right: 32px; }
  h1 { font-size: 30px; }
  .lead { font-size: 16px; }
  /* 行長の抑制（本文段落のみ） */
  main p { max-width: 46em; }
  /* 比較表: 横スクロールなしの全幅表示（タグ列は折返し） */
  .table-compare { overflow-x: visible; }
  .table-compare table { min-width: 0; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .visiting-cards { grid-template-columns: repeat(3, 1fr); }
  .goods-cards:not(.goods-cards--inline) { grid-template-columns: repeat(4, 1fr); }
  /* B枠は幅を抑えて巨大化させない */
  .goods-inline { max-width: 760px; }
  /* トップ: エリア一覧は1列（地方→都道府県の順に上から読む） */
  .area-groups { max-width: 880px; }
  /* 詳細ページ: 店舗情報表・コース料金表は読みやすい幅に */
  table.info-table { max-width: 860px; }
  .table-menus table { max-width: 720px; }
  .salon-visual { margin-top: 16px; }
  .salon-cta .btn-reserve, .salon-cta .btn-official { font-size: 15px; padding: 12px 24px; }
  .prose { max-width: 860px; }
}
