/* 人生ROIマップ 公開サイト共通スタイル。色はWebマップ(template.html)と同じトークン */
:root {
  --sea: #e7eef1; --paper: #f7fafb; --land-empty: #d9e2e6;
  --ink: #13232b; --ink-2: #4b5d66; --muted: #6f8189; --hair: #cfdadf;
  --accent: #1d4e89; --accent-soft: #dbe7f5; --focus: #c2410c; --neg: #b4432f; --pos: #1f7a4d;
  --r0: #cde2fb; --r1: #86b6ef; --r2: #3987e5; --r3: #256abf; --r4: #184f95; --r5: #0d366b;
  --shadow: 0 1px 2px rgba(19,35,43,.06), 0 8px 24px rgba(19,35,43,.06);
  --f-display: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --f-ui: "BIZ UDPGothic", "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --sea: #0d161a; --paper: #131e23; --land-empty: #22313a;
    --ink: #e3ecef; --ink-2: #a8b8bf; --muted: #7f9199; --hair: #26363e;
    --accent: #8db8ec; --accent-soft: #1b3450; --focus: #f08a5d; --neg: #e78a74; --pos: #6fcf9b;
    --r0: #1a3553; --r1: #1c5cab; --r2: #2a78d6; --r3: #5598e7; --r4: #9ec5f4; --r5: #dcebfd;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --sea: #0d161a; --paper: #131e23; --land-empty: #22313a;
  --ink: #e3ecef; --ink-2: #a8b8bf; --muted: #7f9199; --hair: #26363e;
  --accent: #8db8ec; --accent-soft: #1b3450; --focus: #f08a5d; --neg: #e78a74; --pos: #6fcf9b;
  --r0: #1a3553; --r1: #1c5cab; --r2: #2a78d6; --r3: #5598e7; --r4: #9ec5f4; --r5: #dcebfd;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--sea); color: var(--ink); font-family: var(--f-ui); font-size: 15px; line-height: 1.75; }
a { color: var(--accent); text-underline-offset: 3px; }
img, svg { max-width: 100%; }
.wrap { max-width: 1080px; margin: 0 auto; padding-inline: 16px; }
button, input, select { font: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* header */
.site-head { background: var(--paper); border-bottom: 1px solid var(--hair); position: sticky; top: 0; z-index: 20; }
.site-head .wrap { display: flex; align-items: center; gap: 12px; min-height: 52px; }
.brand { font-family: var(--f-display); font-weight: 800; font-size: 19px; color: var(--ink); text-decoration: none; letter-spacing: .04em; white-space: nowrap; }
.site-nav { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a { color: var(--ink-2); text-decoration: none; font-size: 13px; padding: 6px 10px; border-radius: 6px; white-space: nowrap; }
.site-nav a:hover, .site-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--ink); }

/* type */
h1, h2 { font-family: var(--f-display); font-weight: 800; letter-spacing: .02em; line-height: 1.3; text-wrap: balance; }
h1 { font-size: clamp(26px, 5.4vw, 42px); margin: 0 0 10px; }
h2 { font-size: clamp(20px, 3.4vw, 26px); margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 6px; }
.lede { color: var(--ink-2); max-width: 62ch; margin: 0 0 16px; text-wrap: pretty; }
.kicker { font-size: 12px; letter-spacing: .1em; color: var(--accent); font-weight: 700; margin: 0 0 4px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
section.block { padding-block: 28px; }
.crumbs { font-size: 12px; color: var(--muted); padding-top: 14px; }
.crumbs a { color: var(--muted); }

/* panels */
.panel { background: var(--paper); border: 1px solid var(--hair); border-radius: 14px; box-shadow: var(--shadow); padding: 18px; }
.grid { display: grid; gap: 14px; }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }

/* hero & form */
.hero { padding-block: 26px 8px; }
.diag { display: grid; gap: 12px 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
.field.wide { grid-column: span 2; }
@media (max-width: 360px) { .field.wide { grid-column: 1 / -1; } }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label, .field > .lab { font-size: 12px; color: var(--ink-2); font-weight: 700; }
.field input, .field select { width: 100%; min-width: 0; font-size: 16px; color: var(--ink); background: var(--sea); border: 1px solid var(--hair); border-radius: 8px; padding: 9px 10px; }
.field .unit { display: flex; align-items: center; gap: 6px; }
.field .unit span { color: var(--muted); font-size: 13px; white-space: nowrap; }
.seg { display: flex; border: 1px solid var(--hair); border-radius: 8px; overflow: hidden; background: var(--sea); }
.seg button { flex: 1; border: 0; background: transparent; color: var(--ink-2); padding: 9px 6px; cursor: pointer; font-size: 14px; border-right: 1px solid var(--hair); }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--paper); font-weight: 700; }
.kids-ages { display: flex; gap: 6px; flex-wrap: wrap; }
.kids-ages input { width: 5.2em; }
details.more { grid-column: 1 / -1; border-top: 1px dashed var(--hair); padding-top: 10px; }
details.more summary { cursor: pointer; color: var(--accent); font-size: 13px; }
details.more .diag { margin-top: 12px; }
.actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--accent); background: var(--accent); color: var(--paper); border-radius: 10px; padding: 12px 22px; font-size: 16px; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn[disabled] { opacity: .6; cursor: progress; }
.privacy-note { font-size: 12px; color: var(--muted); }

/* result */
.result[hidden] { display: none; }
.progress { height: 6px; background: var(--hair); border-radius: 3px; overflow: hidden; margin: 8px 0; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.headline-age { font-family: var(--f-display); font-weight: 800; font-size: clamp(44px, 12vw, 76px); line-height: 1; color: var(--accent); margin: 6px 0; }
.headline-age small { font-family: var(--f-ui); font-size: 16px; font-weight: 400; color: var(--ink-2); margin-left: 6px; }
.routes { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); margin: 16px 0; }
.route { border: 1px solid var(--hair); border-radius: 12px; padding: 12px 14px; background: var(--sea); }
.route.win { border-color: var(--accent); background: var(--accent-soft); }
.route .rt { font-size: 12px; color: var(--ink-2); font-weight: 700; }
.route .ra { font-family: var(--f-display); font-weight: 800; font-size: 34px; line-height: 1.15; }
.route .ra small { font-family: var(--f-ui); font-size: 13px; font-weight: 400; margin-left: 4px; color: var(--ink-2); }
.route .rd { font-size: 13px; }
.req { border-top: 1px dashed var(--hair); padding-top: 12px; margin-top: 4px; }
.delta-pos { color: var(--pos); font-weight: 700; }
.delta-neg { color: var(--neg); font-weight: 700; }
.two-col { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 760px) { .two-col { grid-template-columns: minmax(0, 1fr); } }
svg.mini-map { width: 100%; height: auto; display: block; background: var(--sea); border-radius: 10px; }
svg.mini-map path { stroke: var(--paper); stroke-width: .6; vector-effect: non-scaling-stroke; }
svg.mini-map path.home { stroke: var(--focus); stroke-width: 2; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11px; color: var(--ink-2); margin-top: 6px; align-items: center; }
.legend i { display: inline-block; width: 14px; height: 10px; border-radius: 2px; vertical-align: middle; margin-right: 3px; }
ol.top { list-style: none; margin: 0; padding: 0; counter-reset: r; }
ol.top li { display: grid; grid-template-columns: 1.6em minmax(0, 1fr) auto auto; gap: 8px; align-items: baseline; padding: 6px 2px; border-bottom: 1px solid var(--hair); font-variant-numeric: tabular-nums; }
ol.top li::before { counter-increment: r; content: counter(r); color: var(--muted); text-align: right; font-size: 13px; }
ol.top li b { font-size: 15px; }
ol.top li .sub { font-size: 12px; color: var(--muted); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--hair); margin-bottom: 10px; }
.tabs button { border: 0; background: none; padding: 8px 10px; cursor: pointer; color: var(--ink-2); border-bottom: 3px solid transparent; font-size: 14px; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 700; }

/* share */
.share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0 4px; }
.share .btn.x { background: #0f1419; border-color: #0f1419; color: #fff; }
.share .btn.line { background: #06c755; border-color: #06c755; color: #fff; }
.friend { border: 1px solid var(--accent); background: var(--accent-soft); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; }

/* insight cards */
.insight { display: flex; flex-direction: column; gap: 6px; }
.insight .big { font-family: var(--f-display); font-weight: 800; font-size: 36px; line-height: 1.1; color: var(--accent); }
.insight .big-label { font-size: 12px; color: var(--muted); }
.insight h3 { font-size: 16px; line-height: 1.5; }
.insight p { margin: 0; font-size: 13px; color: var(--ink-2); }
.insight .row { display: flex; gap: 10px; margin-top: auto; padding-top: 6px; align-items: center; flex-wrap: wrap; }
.linkbtn { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }

/* PR & ads */
.pr { border: 1px solid var(--hair); border-radius: 12px; padding: 14px 16px; background: var(--paper); display: grid; gap: 6px; }
.pr .pr-tag { font-size: 11px; color: var(--muted); border: 1px solid var(--hair); border-radius: 4px; padding: 0 6px; justify-self: start; letter-spacing: .1em; }
.pr h3 { margin: 0; }
.pr p { margin: 0; font-size: 13px; color: var(--ink-2); }
.pr .btn { justify-self: start; }
.pr.placeholder { border-style: dashed; opacity: .85; }
.pr-list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); margin-top: 16px; }
.ad-slot { margin: 18px 0; min-height: 100px; }
.ad-slot .pr-tag { font-size: 11px; color: var(--muted); }

/* tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--hair); border-radius: 10px; background: var(--paper); }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; font-size: 13px; }
th, td { padding: 7px 10px; border-bottom: 1px solid var(--hair); text-align: right; white-space: nowrap; }
th { font-weight: 700; color: var(--ink-2); font-size: 12px; background: var(--sea); position: sticky; top: 0; }
td:first-child, th:first-child, td.l, th.l { text-align: left; }
tr.hl td { background: var(--accent-soft); font-weight: 700; }
td a { text-decoration: none; }
.none { color: var(--neg); }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 1px; background: var(--hair); border: 1px solid var(--hair); border-radius: 12px; overflow: hidden; }
.stat { background: var(--paper); padding: 12px 14px; }
.stat span { display: block; font-size: 12px; color: var(--muted); }
.stat strong { font-family: var(--f-display); font-size: 28px; font-weight: 800; line-height: 1.25; }
.stat strong small { font-family: var(--f-ui); font-size: 13px; font-weight: 400; color: var(--ink-2); margin-left: 2px; }
.stat em { font-style: normal; font-size: 12px; color: var(--ink-2); display: block; }
.stat.lead strong { color: var(--accent); }
.why { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.why li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; font-size: 13px; border-bottom: 1px dotted var(--hair); padding: 4px 0; font-variant-numeric: tabular-nums; }
.why li .rk { color: var(--muted); min-width: 4.5em; text-align: right; }
.bar-row { display: grid; grid-template-columns: 5.5em minmax(0, 1fr) 3.4em; gap: 8px; align-items: center; font-size: 13px; }
.bar-row i { display: block; height: 8px; border-radius: 0 4px 4px 0; background: var(--r3); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips a { font-size: 13px; text-decoration: none; border: 1px solid var(--hair); background: var(--paper); border-radius: 999px; padding: 3px 11px; color: var(--ink); }
.chips a:hover { border-color: var(--accent); }
.pref-index h3 { font-size: 12px; color: var(--muted); margin: 12px 0 6px; letter-spacing: .08em; }

/* faq & notes */
.faq details { border-bottom: 1px solid var(--hair); padding: 10px 0; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq p { margin: 8px 0 0; color: var(--ink-2); font-size: 14px; }
.caveat { border-left: 3px solid var(--hair); padding-left: 12px; color: var(--ink-2); font-size: 13px; }
.prose { max-width: 72ch; }
.prose h2 { margin-top: 28px; }
.prose li { margin-bottom: 4px; }

/* footer */
.site-foot { margin-top: 40px; border-top: 1px solid var(--hair); background: var(--paper); padding-block: 22px 40px; font-size: 13px; color: var(--ink-2); }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 10px; }
.site-foot a { color: var(--ink-2); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { .site-head, .share, .pr, .ad-slot { display: none; } }

/* 市区町村マップ */
.area-controls { display: grid; gap: 10px 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); margin-bottom: 12px; }
.area-main { display: grid; gap: 14px; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 860px) { .area-main { grid-template-columns: minmax(0, 1fr); } }
.mapbox { position: relative; }
svg.area-map { width: 100%; height: auto; display: block; background: var(--sea); border-radius: 10px; touch-action: manipulation; }
svg.area-map path.muni { stroke: var(--paper); stroke-width: .25; vector-effect: non-scaling-stroke; cursor: pointer; transition: fill .2s, opacity .2s; }
svg.area-map path.muni:hover { stroke: var(--ink); stroke-width: 1; }
svg.area-map path.muni.dim { opacity: .25; }
svg.area-map path.muni.zone { stroke: var(--focus); stroke-width: .9; }
svg.area-map .pref-borders path { fill: none; stroke: var(--ink-2); stroke-width: .6; vector-effect: non-scaling-stroke; pointer-events: none; opacity: .55; }
svg.area-map path.sel { fill: none; stroke: var(--focus); stroke-width: 2.4; vector-effect: non-scaling-stroke; pointer-events: none; }
.map-tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--paper); font-size: 12px; padding: 6px 9px; border-radius: 6px; white-space: nowrap; transform: translate(-50%, calc(-100% - 12px)); z-index: 5; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-variant-numeric: tabular-nums; }
ol.top li button { all: unset; cursor: pointer; display: contents; }
ol.rank-list { list-style: none; padding: 0; margin: 0; max-height: 520px; overflow-y: auto; counter-reset: r; }
ol.rank-list li button { width: 100%; display: grid; grid-template-columns: 2.4em minmax(0, 1fr) auto auto; gap: 8px; align-items: baseline; background: none; border: 0; border-bottom: 1px solid var(--hair); padding: 6px 4px; color: var(--ink); cursor: pointer; text-align: left; font-variant-numeric: tabular-nums; }
ol.rank-list li button::before { counter-increment: r; content: counter(r); color: var(--muted); font-size: 12px; text-align: right; }
ol.rank-list li button:hover, ol.rank-list li button[aria-current="true"] { background: var(--accent-soft); }
ol.rank-list .sub { font-size: 12px; color: var(--muted); }
