/* =========================================================
 * 格安SIM比較 試作 — スタイル
 * 姉妹サイト（光回線比較）とトーンを揃えるため、色・角丸・影・余白は
 * :root のデザイントークンに集約しています。統一時はここだけ差し替えてください。
 * 画像は使わず、CSSのみで装飾しています。外部フォント不使用。
 * ========================================================= */

:root {
  /* カラー */
  --c-primary: #0f6fde;        /* メイン（信頼感のある青） */
  --c-primary-dark: #0a4fa3;
  --c-primary-soft: #e8f1fd;
  --c-accent: #ff7a1a;         /* 強調（最安・注目） */
  --c-accent-soft: #fff1e6;
  --c-line: #06c755;           /* LINEボタン */
  --c-line-dark: #04a446;
  --c-text: #1f2937;
  --c-text-sub: #5b6573;
  --c-border: #e2e6ec;
  --c-bg: #ffffff;
  --c-bg-alt: #f5f7fa;
  --c-warn-bg: #fff8e1;
  --c-warn-border: #f2c94c;
  --c-warn-text: #7a5a00;
  --c-ok: #1a9c5b;
  --c-ng: #a0a8b4;

  /* 回線の系統カラー */
  --net-docomo: #d6334a;
  --net-au: #e8730c;
  --net-softbank: #6b7686;
  --net-rakuten: #b0236e;

  /* 形状 */
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 2px 10px rgba(15, 35, 70, .08);
  --shadow-lg: 0 8px 28px rgba(15, 35, 70, .12);

  /* 文字 */
  --font: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  --fs-base: 16px;
  --container: 1080px;
}

/* ---------- ベース ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.75;
  color: var(--c-text);
  background: var(--c-bg);
  padding-bottom: 76px; /* 追従CTA分 */
}
h1, h2, h3 { line-height: 1.4; margin: 0; }
p { margin: 0; }
a { color: var(--c-primary); }
.container { max-width: var(--container); margin: 0 auto; padding: 0 16px; }
.sp-only { display: inline; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 8px; top: 8px; z-index: 100; background: #fff; padding: 8px 12px; border-radius: var(--radius-sm); }
:focus-visible { outline: 3px solid var(--c-primary); outline-offset: 2px; }
.note { font-size: 12px; color: var(--c-text-sub); margin-top: 6px; }

/* ---------- 試作バナー ---------- */
.proto-banner {
  background: var(--c-warn-bg);
  border-bottom: 1px solid var(--c-warn-border);
  color: var(--c-warn-text);
  font-size: 13px;
  padding: 8px 16px;
  text-align: center;
}

/* ---------- ヘッダー ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--c-border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--c-text); font-weight: 700; }
.logo-mark {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark));
  color: #fff; font-size: 17px;
}
.logo-text small { font-size: 11px; color: var(--c-text-sub); margin-left: 2px; font-weight: 500; }
.header-nav { display: none; gap: 20px; }
.header-nav a { color: var(--c-text); text-decoration: none; font-size: 14px; font-weight: 600; }
.header-nav a:hover { color: var(--c-primary); }

/* ---------- ヒーロー（導入） ---------- */
.hero {
  padding: 36px 0 40px;
  background:
    radial-gradient(circle at 90% 10%, rgba(15, 111, 222, .12) 0, transparent 40%),
    radial-gradient(circle at 0% 100%, rgba(255, 122, 26, .10) 0, transparent 35%),
    var(--c-primary-soft);
}
.eyebrow {
  display: inline-block; font-size: 12px; font-weight: 700; color: var(--c-primary);
  background: #fff; border-radius: 999px; padding: 3px 12px; margin-bottom: 12px;
}
.hero h1 { font-size: 26px; letter-spacing: .02em; }
.hero-lead { margin-top: 14px; color: var(--c-text); }
.hero-lead strong { background: linear-gradient(transparent 60%, rgba(255, 122, 26, .3) 60%); }
.hero-points { display: grid; gap: 10px; margin-top: 22px; }
.point-card {
  display: flex; gap: 12px; align-items: flex-start;
  background: #fff; border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow);
  font-size: 14px;
}
.point-num { font-weight: 800; color: var(--c-primary); font-size: 18px; line-height: 1.4; }

.calc-card {
  margin-top: 22px; background: #fff; border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow-lg);
  border-top: 4px solid var(--c-accent);
}
.calc-title { font-size: 16px; margin-bottom: 12px; }
.calc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; font-size: 14px; }
.input-yen { display: flex; align-items: center; gap: 6px; }
.input-yen input {
  width: 120px; font: inherit; font-size: 16px; text-align: right; padding: 8px 10px;
  border: 1px solid var(--c-border); border-radius: var(--radius-sm);
}
.calc-result {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px;
  background: var(--c-accent-soft); border-radius: var(--radius); padding: 12px;
}
.calc-result > div { display: flex; flex-direction: column; text-align: center; }
.calc-label { font-size: 12px; color: var(--c-text-sub); }
.calc-value { font-size: 17px; font-weight: 800; color: var(--c-accent); }

/* ---------- セクション共通 ---------- */
.section { padding: 48px 0; }
.section-alt { background: var(--c-bg-alt); }
.section-eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .15em; color: var(--c-primary); }
.section-title { font-size: 22px; margin-top: 4px; position: relative; padding-bottom: 10px; }
.section-title::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 40px; height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-accent));
}
.section-lead { margin-top: 12px; color: var(--c-text-sub); font-size: 14px; }

/* ---------- バッジ・記号 ---------- */
.badge {
  display: inline-block; font-size: 11px; font-weight: 700; line-height: 1;
  border-radius: 999px; padding: 4px 8px; vertical-align: middle;
}
.badge-sample { background: var(--c-warn-border); color: #4a3700; }
.badge-ok { background: var(--c-ok); color: #fff; }
.badge-best { background: var(--c-accent); color: #fff; margin-left: 4px; }
.mark { font-weight: 800; font-size: 16px; }
.mark-yes { color: var(--c-ok); }
.mark-no { color: var(--c-ng); }
.tbc {
  display: inline-block; font-size: 11px; font-weight: 700; color: var(--c-warn-text);
  background: var(--c-warn-bg); border: 1px dashed var(--c-warn-border);
  border-radius: var(--radius-sm); padding: 1px 6px; white-space: nowrap;
}
.na {
  display: inline-block; font-size: 11px; color: var(--c-text-sub);
  background: var(--c-bg-alt); border-radius: var(--radius-sm); padding: 1px 6px; white-space: nowrap;
}

.sample-alert {
  margin-top: 18px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  background: var(--c-warn-bg); border: 1px solid var(--c-warn-border); color: var(--c-warn-text);
  border-radius: var(--radius); padding: 10px 14px; font-size: 13px; font-weight: 600;
}
.sample-alert.is-verified { background: #eaf7f0; border-color: var(--c-ok); color: #135f3a; }

/* ---------- 操作パネル ---------- */
.controls {
  display: grid; gap: 14px; margin-top: 18px;
  background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius); padding: 14px;
}
.control-group { display: flex; flex-direction: column; gap: 6px; }
.control-label { font-size: 12px; font-weight: 700; color: var(--c-text-sub); }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--c-bg-alt); border-radius: 999px; padding: 4px; }
.seg-btn {
  font: inherit; font-weight: 700; font-size: 15px; border: 0; background: transparent; color: var(--c-text-sub);
  padding: 8px 0; border-radius: 999px; cursor: pointer; transition: background .15s, color .15s;
}
.seg-btn.is-active { background: var(--c-primary); color: #fff; box-shadow: 0 2px 6px rgba(15, 111, 222, .35); }
.select-wrap { position: relative; }
.select-wrap::after {
  content: ""; position: absolute; right: 14px; top: 50%; width: 8px; height: 8px; margin-top: -6px;
  border-right: 2px solid var(--c-text-sub); border-bottom: 2px solid var(--c-text-sub); transform: rotate(45deg); pointer-events: none;
}
.select-wrap select {
  width: 100%; font: inherit; font-size: 15px; padding: 9px 36px 9px 12px; appearance: none; -webkit-appearance: none;
  border: 1px solid var(--c-border); border-radius: var(--radius-sm); background: #fff; color: var(--c-text);
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; }
.chip span {
  display: inline-block; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--c-border); background: #fff; color: var(--c-text-sub);
}
.chip input:checked + span { background: var(--c-primary-soft); border-color: var(--c-primary); color: var(--c-primary-dark); }
.chip input:checked + span::before { content: "✓ "; }
.chip input:focus-visible + span { outline: 3px solid var(--c-primary); outline-offset: 2px; }

/* ---------- 比較表 ---------- */
.table-hint { display: block; text-align: center; font-size: 12px; color: var(--c-text-sub); margin-top: 14px; }
.table-scroll {
  margin-top: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--c-border); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow);
}
.compare-table { width: 100%; min-width: 860px; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.compare-table th, .compare-table td {
  padding: 12px 10px; border-bottom: 1px solid var(--c-border); text-align: center; vertical-align: middle;
}
.compare-table thead th {
  background: var(--c-primary-dark); color: #fff; font-size: 12px; font-weight: 700; white-space: nowrap;
}
.compare-table thead th.col-price { background: var(--c-primary); }
.th-sub { font-size: 11px; opacity: .85; }
.compare-table tbody tr:last-child th, .compare-table tbody tr:last-child td { border-bottom: 0; }
.compare-table tbody tr:nth-child(even) td { background: #fafbfd; }
.compare-table .col-name {
  position: sticky; left: 0; z-index: 1; text-align: left; min-width: 128px; background: #fff;
  box-shadow: 1px 0 0 var(--c-border);
}
.compare-table thead .col-name { background: var(--c-primary-dark); z-index: 2; }
.svc-name { display: block; font-weight: 800; font-size: 14px; }
.svc-type { display: block; font-size: 11px; color: var(--c-text-sub); font-weight: 500; }
.col-price { min-width: 110px; }
.col-price.is-best { background: var(--c-accent-soft) !important; }
.price { font-size: 18px; font-weight: 800; color: var(--c-text); }
.price small { font-size: 11px; font-weight: 600; margin-left: 1px; }
.price-sm { font-weight: 700; }
.price-sm small { font-size: 10px; font-weight: 500; }
.cell-sub { display: block; font-size: 10.5px; color: var(--c-text-sub); line-height: 1.4; margin-top: 3px; }
.col-net { min-width: 92px; }
.net {
  display: inline-block; font-size: 11px; font-weight: 700; color: #fff; border-radius: 4px;
  padding: 2px 6px; margin: 2px; white-space: nowrap;
}
.net-docomo { background: var(--net-docomo); }
.net-au { background: var(--net-au); }
.net-softbank { background: var(--net-softbank); }
.net-rakuten { background: var(--net-rakuten); }
.empty-msg { margin-top: 12px; text-align: center; color: var(--c-text-sub); font-size: 14px; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; padding: 0; margin: 12px 0 0; font-size: 12px; color: var(--c-text-sub); }
.legend li { display: flex; align-items: center; gap: 4px; }

/* ---------- タイプ別おすすめ ---------- */
.persona-grid { display: grid; gap: 14px; margin-top: 20px; }
.persona {
  background: #fff; border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow);
  border: 1px solid var(--c-border);
}
.persona-head { display: flex; gap: 12px; align-items: center; }
.persona-icon {
  flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
  background: var(--c-primary-soft); font-size: 22px;
}
.persona h3 { font-size: 17px; }
.persona-lead { font-size: 13px; color: var(--c-text-sub); }
.persona-cond {
  margin-top: 12px; font-size: 12px; font-weight: 700; color: var(--c-primary-dark);
  background: var(--c-primary-soft); border-radius: var(--radius-sm); padding: 4px 10px; display: inline-block;
}
.picks { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.pick { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: var(--radius); background: var(--c-bg-alt); }
.pick-rank {
  flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--c-accent); color: #fff; font-weight: 800; font-size: 13px;
}
.pick:nth-child(2) .pick-rank { background: var(--c-primary); }
.pick-body { display: flex; flex-direction: column; }
.pick-name { font-weight: 800; }
.pick-price { font-size: 13px; font-weight: 700; color: var(--c-accent); }
.pick-price small { color: var(--c-text-sub); font-weight: 500; }
.pick-memo { font-size: 12px; color: var(--c-text-sub); line-height: 1.6; margin-top: 2px; }
.pick-empty { font-size: 13px; color: var(--c-text-sub); }
.persona-point { margin-top: 12px; font-size: 13px; border-top: 1px dashed var(--c-border); padding-top: 10px; }
.persona-point::before { content: "POINT"; font-size: 10px; font-weight: 800; color: var(--c-accent); margin-right: 6px; letter-spacing: .1em; }

/* ---------- 乗り換えの流れ ---------- */
.steps { list-style: none; padding: 0; margin: 24px 0 0; position: relative; }
.step { display: flex; gap: 14px; position: relative; padding-bottom: 20px; }
.step:not(:last-child)::before {
  content: ""; position: absolute; left: 19px; top: 40px; bottom: 0; width: 2px; background: var(--c-primary-soft);
}
.step-num {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--c-primary); color: #fff; font-weight: 800; font-size: 17px; position: relative; z-index: 1;
  box-shadow: 0 0 0 4px #fff;
}
.step-body { background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius); padding: 12px 14px; flex: 1; }
.step-body h3 { font-size: 16px; }
.step-body p { font-size: 14px; color: var(--c-text-sub); margin-top: 4px; }
.tip-box { margin-top: 8px; background: var(--c-accent-soft); border-radius: var(--radius); padding: 16px; }
.tip-title { font-weight: 800; color: var(--c-accent); }
.checklist { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; font-size: 14px; }
.checklist li::before { content: "☐"; margin-right: 8px; color: var(--c-accent); font-weight: 700; }

/* ---------- FAQ ---------- */
.faq-list { margin-top: 20px; display: grid; gap: 10px; }
.faq { background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden; }
.faq summary {
  list-style: none; cursor: pointer; padding: 14px 44px 14px 46px; font-weight: 700; position: relative; font-size: 15px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: "Q"; position: absolute; left: 14px; top: 13px; width: 24px; height: 24px; display: grid; place-items: center;
  border-radius: 50%; background: var(--c-primary); color: #fff; font-size: 13px; font-weight: 800;
}
.faq summary::after {
  content: ""; position: absolute; right: 18px; top: 50%; width: 9px; height: 9px; margin-top: -7px;
  border-right: 2px solid var(--c-text-sub); border-bottom: 2px solid var(--c-text-sub); transform: rotate(45deg); transition: transform .2s;
}
.faq[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq-a { padding: 0 16px 16px 46px; position: relative; font-size: 14px; color: var(--c-text-sub); }
.faq-a::before {
  content: "A"; position: absolute; left: 14px; top: 0; width: 24px; height: 24px; display: grid; place-items: center;
  border-radius: 50%; background: var(--c-accent); color: #fff; font-size: 13px; font-weight: 800;
}

/* ---------- CTA ---------- */
.cta { padding: 48px 0 56px; background: linear-gradient(160deg, var(--c-primary) 0%, var(--c-primary-dark) 100%); }
.cta-card {
  background: #fff; border-radius: var(--radius-lg); padding: 28px 20px; text-align: center; box-shadow: var(--shadow-lg);
  position: relative; overflow: hidden;
}
.cta-card::before {
  content: ""; position: absolute; top: -40px; right: -40px; width: 120px; height: 120px; border-radius: 50%;
  background: var(--c-accent-soft);
}
.cta-card > * { position: relative; }
.cta-eyebrow { font-size: 13px; font-weight: 800; color: var(--c-accent); }
.cta-title { font-size: 22px; margin-top: 6px; }
.cta-lead { margin-top: 12px; font-size: 14px; color: var(--c-text-sub); }
.cta-note { margin-top: 10px; font-size: 12px; color: var(--c-text-sub); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 800; text-decoration: none; border-radius: 999px; transition: transform .1s, background .15s;
}
.btn:active { transform: translateY(1px); }
.btn-line {
  margin-top: 18px; width: 100%; max-width: 360px; padding: 16px 20px; font-size: 17px;
  background: var(--c-line); color: #fff; box-shadow: 0 4px 0 var(--c-line-dark);
}
.btn-line:hover { background: var(--c-line-dark); }
.btn-line-icon {
  font-size: 10px; font-weight: 900; background: #fff; color: var(--c-line); border-radius: 6px; padding: 3px 5px; letter-spacing: .02em;
}
.btn-sm { margin-top: 0; padding: 12px 16px; font-size: 15px; max-width: none; }

.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .96); border-top: 1px solid var(--c-border); box-shadow: 0 -4px 14px rgba(0, 0, 0, .06);
  transition: transform .25s;
}
.sticky-cta.is-hidden { transform: translateY(110%); }

/* ---------- フッター ---------- */
.site-footer { background: #1b2433; color: #c4cbd6; padding: 28px 0 24px; font-size: 12px; }
.footer-copy { margin-top: 10px; color: #8a94a3; }

/* =========================================================
 * タブレット以上
 * ========================================================= */
@media (min-width: 768px) {
  body { padding-bottom: 0; }
  .sp-only { display: none; }
  .header-nav { display: flex; }
  .hero { padding: 56px 0 60px; }
  .hero h1 { font-size: 36px; }
  .hero-lead { font-size: 17px; max-width: 680px; }
  .hero-points { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .calc-card { max-width: 560px; }
  .section { padding: 72px 0; }
  .section-title { font-size: 28px; }
  .controls { grid-template-columns: 1.2fr 1fr 1.4fr; align-items: end; }
  .compare-table { font-size: 14px; }
  .persona-grid { grid-template-columns: repeat(2, 1fr); gap: 18px; }
  .steps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 24px; }
  .step { padding-bottom: 0; }
  .step:not(:last-child)::before { display: none; }
  .cta-card { padding: 44px 32px; }
  .cta-title { font-size: 28px; }
  .sticky-cta { display: none; }
}

@media (min-width: 1024px) {
  .persona-grid { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
