:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --ink: #1f2a37;
  --ink-soft: #5b6776;
  --brand: #1f7a5a;
  --brand-dark: #155c43;
  --brand-soft: #e3f3ec;
  --accent: #f2a93b;
  --line: #e2e8f0;
  --warn: #c0392b;
  --radius: 16px;
  --shadow: 0 6px 20px rgba(31, 42, 55, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  font-size: 17px;
}

/* ===== ヘッダー ===== */
.site-header {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  text-align: center;
  padding: 32px 20px 28px;
}
.logo {
  margin: 0;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.logo span {
  color: var(--accent);
}
.tagline {
  margin: 8px 0 0;
  font-size: 16px;
  opacity: 0.95;
}
.site-nav { margin-top: 12px; }
.site-nav a {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.4);
}
.site-nav a:hover { background: rgba(255, 255, 255, 0.28); }

/* ===== レイアウト ===== */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.intro { margin-bottom: 24px; }
.lead {
  font-size: 18px;
  margin: 0 0 16px;
}
.coverage {
  display: inline-block;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 700;
  font-size: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  margin: 0 0 14px;
}
.disclaimer-top {
  background: #fff8ec;
  border: 1px solid #f3dca8;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0;
}

/* ===== 質問 ===== */
.qgroup {
  background: var(--card);
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 0 0 18px;
  padding: 18px 18px 8px;
}
.qgroup legend {
  font-weight: 700;
  font-size: 18px;
  color: var(--brand-dark);
  padding: 0 6px;
}
.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 0 12px;
}
.option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  min-height: 56px;
}
.option:hover { border-color: var(--brand); }
.option input { position: absolute; opacity: 0; width: 0; height: 0; }
.box {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border: 2px solid #c2ccd6;
  border-radius: 7px;
  display: inline-block;
  position: relative;
  background: #fff;
}
.option input:checked + .box {
  background: var(--brand);
  border-color: var(--brand);
}
.option input:checked + .box::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 3px;
  width: 7px;
  height: 13px;
  border: solid #fff;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}
.option input:checked ~ .label-text { font-weight: 700; }
.option:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.option input:focus-visible + .box {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.label-text { font-size: 16px; }

/* ===== くわしく診断（年収・年齢） ===== */
.profile .profile-note {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 6px 14px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 6px 14px;
}
.field label {
  font-weight: 700;
  font-size: 15px;
  color: var(--brand-dark);
}
.field select {
  font-family: inherit;
  font-size: 16px;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  min-height: 52px;
  cursor: pointer;
}
.field select:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--brand);
}

/* ===== ボタン ===== */
.actions {
  text-align: center;
  margin-top: 24px;
}
.btn-primary, .btn-secondary {
  border: none;
  border-radius: 999px;
  font-size: 19px;
  font-weight: 700;
  padding: 16px 36px;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.1s, box-shadow 0.15s, background 0.15s;
}
.btn-primary {
  background: var(--accent);
  color: #3a2700;
  box-shadow: 0 6px 16px rgba(242, 169, 59, 0.4);
}
.btn-primary:hover { background: #e89c2a; }
.btn-primary:active { transform: translateY(1px); }
.btn-secondary {
  background: #fff;
  color: var(--brand-dark);
  border: 2px solid var(--brand);
}
.btn-secondary:hover { background: var(--brand-soft); }

.hint {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 14px 0 0;
}
.hint.warn { color: var(--warn); font-weight: 700; }

/* ===== 結果 ===== */
.results {
  margin-top: 40px;
  border-top: 3px dashed var(--line);
  padding-top: 28px;
}
.results-head { text-align: center; margin-bottom: 24px; }
#results-title {
  font-size: 22px;
  color: var(--brand-dark);
  margin: 0 0 8px;
}
#results-sub {
  font-size: 15px;
  color: var(--ink-soft);
  margin: 0;
}
.cat-block { margin-bottom: 28px; }
.cat-title {
  font-size: 17px;
  color: #fff;
  background: var(--brand);
  display: inline-block;
  padding: 6px 18px;
  border-radius: 999px;
  margin: 0 0 14px;
}
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 14px;
  border-left: 6px solid var(--accent);
}
.card-name {
  font-size: 20px;
  margin: 0 0 6px;
  color: var(--ink);
}
.card-summary {
  margin: 0 0 14px;
  color: var(--ink-soft);
}
.card-meta {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card-meta > div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
}
.card-meta dt {
  font-weight: 700;
  font-size: 14px;
  color: var(--brand-dark);
  background: var(--brand-soft);
  border-radius: 8px;
  padding: 2px 8px;
  text-align: center;
  height: fit-content;
}
.card-meta dd { margin: 0; font-size: 15px; }
.card-search {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--ink-soft);
}
.card-search strong { color: var(--brand-dark); }

.local-chip {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: #8a5a00;
  background: #fff1d6;
  border-radius: 999px;
  padding: 2px 10px;
  margin-left: 10px;
  vertical-align: middle;
}

/* ===== アフィリエイト（PR）カード ===== */
.aff-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0 0;
  padding: 12px 14px;
  background: #fffaf2;
  border: 1px solid #f0dcb8;
  border-radius: 12px;
  text-decoration: none;
  color: var(--ink);
}
.aff-card:hover { background: #fff4e2; }
.aff-pr {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  color: #8a5a00;
  background: #ffe6bd;
  border-radius: 6px;
  padding: 2px 7px;
}
.aff-body { flex: 1 1 auto; display: flex; flex-direction: column; }
.aff-label { font-weight: 700; color: var(--brand-dark); font-size: 15px; }
.aff-desc { font-size: 13px; color: var(--ink-soft); }
.aff-arrow { flex: 0 0 auto; font-size: 22px; color: var(--accent); font-weight: 700; }

/* ===== 自治体の収録データ ===== */
.local-detail {
  background: #eaf4ff;
  border: 1px solid #c7e0fb;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0 0 14px;
}
.ld-head { margin: 0 0 4px; font-weight: 700; color: #1c5fa8; font-size: 15px; }
.ld-text { margin: 0 0 4px; font-size: 15px; color: var(--ink); }
.ld-as { margin: 0; font-size: 12px; color: var(--ink-soft); }
.local-note {
  background: #fff8ec;
  border: 1px solid #f3dca8;
  border-radius: 10px;
  padding: 9px 12px;
  margin: 0 0 14px;
  font-size: 14px;
  color: #8a5a00;
}

/* ===== 条件次第（対象外かも）===== */
.maybe-out {
  margin-top: 12px;
  background: #fbf7f0;
  border: 1px solid #ecdcc2;
  border-radius: var(--radius);
  padding: 20px 16px;
}
.maybe-title {
  font-size: 17px;
  color: #8a5a00;
  margin: 0 0 6px;
}
.maybe-sub {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 16px;
}
.card-maybe {
  border-left-color: #d9a441;
  opacity: 0.96;
}
.card-reason {
  background: #fff1d6;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 700;
  color: #8a5a00;
}

/* ===== フッター ===== */
/* ===== アフィリエイト（PR）枠 ===== */
.affiliate-zone {
  margin: 28px 0 8px;
  padding: 16px;
  border: 1px dashed #d8dee6;
  border-radius: var(--radius);
  background: #fbfcfd;
}
.affiliate-zone-label {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0 0 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.affiliate-slot {
  margin-bottom: 12px;
}
.affiliate-slot:last-child { margin-bottom: 0; }
.affiliate-slot:not(.affiliate-ready) { display: none; }
.aff-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  background: #c0392b;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  margin-right: 10px;
  vertical-align: middle;
}
.aff-link {
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
  margin-top: 6px;
}
.aff-link:hover {
  border-color: var(--brand);
  box-shadow: 0 4px 14px rgba(31, 122, 90, 0.12);
}
.aff-link strong {
  display: block;
  font-size: 16px;
  color: var(--ink);
  margin-bottom: 4px;
}
.aff-desc {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin-bottom: 8px;
}
.aff-cta {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-dark);
}
.aff-text {
  margin-bottom: 10px;
}
.aff-text strong {
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
}
.aff-creative {
  text-align: center;
}
.aff-creative img { max-width: 100%; height: auto; }
/* テキストリンクのみのA8広告をボタン化して目立たせる */
.aff-creative > a:not(:has(img)) {
  display: inline-block;
  padding: 12px 24px;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  margin: 6px 0;
  transition: background 0.15s, transform 0.1s;
}
.aff-creative > a:not(:has(img)):hover {
  background: var(--brand-dark);
}
.aff-creative > a:not(:has(img)):active {
  transform: translateY(1px);
}

.site-footer {
  background: #eceff3;
  padding: 24px 16px;
}
.footer-nav {
  max-width: 720px;
  margin: 0 auto 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
}
.footer-nav a {
  color: var(--ink-soft);
  font-size: 13px;
  text-decoration: none;
  font-weight: 700;
}
.footer-nav a:hover { color: var(--brand-dark); text-decoration: underline; }
.site-credit {
  max-width: 720px;
  margin: 0 auto 8px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-soft);
}
.last-updated {
  max-width: 720px;
  margin: 0 auto 8px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-soft);
}
.disclaimer {
  max-width: 720px;
  margin: 0 auto;
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.6;
}

/* ===== レイアウト（質問＋サイドバー） ===== */
.container { max-width: 1040px; padding-bottom: 104px; }
.intro { max-width: 760px; margin-left: auto; margin-right: auto; }
.results { max-width: 820px; margin-left: auto; margin-right: auto; }

.layout { display: block; }
.main-col { min-width: 0; }

/* モバイル既定：下部固定バー */
.side-col {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  background: #fff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px rgba(31, 42, 55, 0.12);
}
.side-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.side-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: var(--brand-soft);
  border: none;
  border-radius: 10px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-dark);
  cursor: pointer;
}
.side-summary strong { color: var(--brand); font-size: 19px; margin: 0 2px; }
.side-caret { font-size: 12px; transition: transform 0.2s; }
.side-col.open .side-caret { transform: rotate(180deg); }

.side-detail { display: none; }
.side-col.open .side-detail {
  display: block;
  max-height: 52vh;
  overflow-y: auto;
  padding-top: 6px;
}
.side-title { font-size: 14px; color: var(--ink-soft); margin: 6px 0; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-empty { color: var(--ink-soft); font-size: 14px; }
.chip {
  background: var(--brand-soft);
  color: var(--brand-dark);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 13px;
  font-weight: 700;
}
.side-count-block { margin-top: 14px; }
.side-count-label { font-size: 14px; color: var(--ink-soft); margin: 0; }
.side-count-big { margin: 0; font-weight: 800; color: var(--brand-dark); }
.side-count-big span { font-size: 30px; color: var(--accent); margin-right: 4px; }
.live-extra { font-size: 13px; color: #8a5a00; margin: 2px 0 6px; font-weight: 700; }
.breakdown {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.breakdown li {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 4px 0;
  border-bottom: 1px dashed var(--line);
}
.bd-num { font-weight: 700; color: var(--brand-dark); }

.side-cta { width: 100%; font-size: 18px; padding: 15px 20px; }
.side-inner .hint { margin: 0; text-align: center; }

/* デスクトップ：右サイドに固定列 */
@media (min-width: 880px) {
  .container { padding-bottom: 48px; }
  .layout { display: flex; gap: 24px; align-items: flex-start; }
  .main-col { flex: 1 1 auto; }
  .side-col {
    position: sticky;
    top: 16px;
    bottom: auto;
    flex: 0 0 312px;
    width: 312px;
    background: transparent;
    border-top: none;
    box-shadow: none;
  }
  .side-inner {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
    max-width: none;
    margin: 0;
  }
  .side-toggle { display: none; }
  .side-detail { display: block; max-height: none; overflow: visible; }
}

/* ===== ブログ ===== */
.blog-wrap { max-width: 760px; }
.back-link {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--brand-dark);
  font-weight: 700;
  text-decoration: none;
}
.back-link:hover { text-decoration: underline; }
.post-list { display: flex; flex-direction: column; gap: 16px; list-style: none; padding: 0; margin: 0; }
.post-card {
  display: block;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  text-decoration: none;
  color: var(--ink);
  border-left: 6px solid var(--brand);
}
.post-card:hover { box-shadow: 0 10px 26px rgba(31, 42, 55, 0.12); }
.post-meta { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.post-date { font-size: 13px; color: var(--ink-soft); }
.post-tag {
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 10px;
}
.tag-news { background: var(--brand-soft); color: var(--brand-dark); }
.tag-watch { background: #fdeccd; color: #8a5a00; }
.tag-howto { background: #e7eefc; color: #1c5fa8; }
.post-card h3 { margin: 0 0 6px; font-size: 19px; color: var(--ink); }
.post-card p { margin: 0; color: var(--ink-soft); font-size: 15px; }

.article { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 24px; }
.article h2 { font-size: 24px; color: var(--ink); margin: 8px 0 6px; line-height: 1.4; }
.article h3 { font-size: 18px; color: var(--brand-dark); margin: 26px 0 8px; }
.article p { margin: 0 0 14px; }
.article ul { margin: 0 0 14px; padding-left: 1.3em; }
.article li { margin-bottom: 6px; }
.cta-box {
  background: var(--brand-soft);
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  margin: 24px 0;
}
.cta-box a {
  display: inline-block;
  background: var(--accent);
  color: #3a2700;
  font-weight: 700;
  text-decoration: none;
  padding: 13px 28px;
  border-radius: 999px;
  margin-top: 8px;
}
.note-box {
  background: #fff8ec;
  border: 1px solid #f3dca8;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  color: #8a5a00;
  margin: 16px 0;
}

/* ===== レスポンシブ ===== */
@media (max-width: 480px) {
  .logo { font-size: 27px; }
  .card-meta > div { grid-template-columns: 1fr; gap: 4px; }
  .card-meta dt { justify-self: start; }
  .btn-primary, .btn-secondary { width: 100%; }
}
