/* layout: 見出しと操作部を上に、1枚絵（上=男性の流れ / 中央=給与レンジの円盤 / 下=女性の流れ）を主役に置く */
:root{
  --bg:#ffffff; --ink:#4a4a4f; --ink-soft:#8b8b92; --ink-faint:#b9b9bf;
  --flow:#cfcfd2; --flow-hi:#77777d; --line:#e4e4e8; --panel:#ffffff; --accent:#542788;
  --neutral-disc:#f1f1f3;
  --font: "Hiragino Sans","Hiragino Kaku Gothic ProN","Yu Gothic Medium","Yu Gothic",Meiryo,"Noto Sans JP","Noto Sans CJK JP",sans-serif;
  color-scheme:light;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#18181c; --ink:#dcdce2; --ink-soft:#9a9aa3; --ink-faint:#5f5f68;
    --flow:#45454d; --flow-hi:#b4b4bd; --line:#2e2e35; --panel:#222228; --accent:#b2abd2;
    --neutral-disc:#ececf0; color-scheme:dark;
  }
}
:root[data-theme="dark"]{
  --bg:#18181c; --ink:#dcdce2; --ink-soft:#9a9aa3; --ink-faint:#5f5f68;
  --flow:#45454d; --flow-hi:#b4b4bd; --line:#2e2e35; --panel:#222228; --accent:#b2abd2;
  --neutral-disc:#ececf0; color-scheme:dark;
}
*{box-sizing:border-box}
html,body{margin:0}
body{background:var(--bg);color:var(--ink);font-family:var(--font);font-size:14px;line-height:1.6}
main{max-width:1280px;margin:0 auto;padding:24px 20px 32px;display:flex;flex-direction:column;gap:14px}
h1{font-size:clamp(20px,2.6vw,27px);font-weight:500;margin:0;text-wrap:balance;letter-spacing:.02em}
.lede{margin:0;font-size:12.5px;color:var(--ink-soft);max-width:64em}
.controls{display:flex;flex-wrap:wrap;gap:12px 28px;align-items:center;padding:10px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.ctl{display:flex;align-items:center;gap:10px;font-size:12.5px;color:var(--ink-soft)}
.ctl b{font-weight:700;color:var(--ink);font-size:20px;font-variant-numeric:tabular-nums;min-width:4.2em}
.ctl b small{font-size:11px;font-weight:500;color:var(--ink-soft);margin-left:2px}
.yearctl{flex:1 1 440px;max-width:600px;flex-wrap:wrap}
.yearpick{position:relative;flex:1 1 280px;min-width:250px;height:40px}
.yearpick input{-webkit-appearance:none;appearance:none;position:relative;z-index:1;display:block;width:100%;height:22px;margin:0;background:transparent;cursor:pointer}
.yearpick input::-webkit-slider-runnable-track{height:2px;background:var(--ink-faint);border-radius:1px}
.yearpick input::-moz-range-track{height:2px;background:var(--ink-faint);border-radius:1px}
.yearpick input::-webkit-slider-thumb{-webkit-appearance:none;box-sizing:border-box;width:16px;height:16px;margin-top:-7px;border-radius:50%;background:var(--accent);border:2px solid var(--bg);box-shadow:0 0 0 1.5px var(--accent)}
.yearpick input::-moz-range-thumb{box-sizing:border-box;width:16px;height:16px;border-radius:50%;background:var(--accent);border:2px solid var(--bg);box-shadow:0 0 0 1.5px var(--accent)}
.yticks{position:absolute;left:8px;right:8px;top:11px;display:flex;justify-content:space-between}
.yt{width:0;display:flex;flex-direction:column;align-items:center}
.yt i{width:1px;height:6px;background:var(--ink-faint)}
.yt button{border:0;background:none;padding:2px 1px;font-size:9.5px;line-height:1.2;color:var(--ink-soft);font-variant-numeric:tabular-nums;border-radius:3px}
.yt.cur button{color:var(--ink);font-weight:700}
.yt.cur i{background:var(--accent)}
@media (max-width:520px){.yearctl #play{order:2;margin-left:auto}.yearpick{order:3;flex-basis:100%}}
button{white-space:nowrap}
button,select{font:inherit;color:var(--ink);background:var(--panel);border:1px solid var(--ink-faint);border-radius:6px;padding:4px 12px;cursor:pointer}
button:hover,select:hover{border-color:var(--ink-soft)}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
:focus:not(:focus-visible){outline:none}
#zcard:focus{outline:none}
.seg{display:inline-flex;border:1px solid var(--ink-faint);border-radius:6px;overflow:hidden}
.seg button{border:0;border-radius:0;padding:4px 14px}
.seg button + button{border-left:1px solid var(--ink-faint)}
.seg button[aria-pressed="true"]{background:var(--ink);color:var(--bg)}
.chartwrap{position:relative;display:flex;flex-direction:column;gap:14px}
.chart{overflow:hidden}
.flow{stroke-linejoin:round}
.legends{display:flex;flex-wrap:wrap;gap:12px 32px}
.lg h3{font-size:13px;margin:0;font-weight:700;line-height:1.4}
.lg p{font-size:10.5px;color:var(--ink-soft);margin:0 0 5px;line-height:1.35}
#lgflow{display:block;width:120px;height:74px}
#lgflow text,#lgdisc text{font-size:10px;fill:var(--ink-soft)}
#lgdisc{display:block;width:150px;height:44px}
#lgband{display:flex;flex-wrap:wrap;gap:3px 4px;max-width:520px}
.lgb{border:0;background:none;padding:2px 7px 2px 3px;font-size:10.5px;display:inline-flex;align-items:center;gap:6px;border-radius:4px;line-height:1.3;white-space:nowrap}
.lgb i{width:22px;height:10px;display:inline-block;border:1px solid transparent;flex:none}
.lgb[aria-pressed="true"]{font-weight:700;background:color-mix(in srgb,var(--accent) 14%,transparent)}
.bandsel .lgb[aria-pressed="false"]{opacity:.4}
.wide .legends{display:contents}
.wide .lg{position:absolute;right:0;width:186px;z-index:1}
.wide .lg-flow{top:6px}
.wide .lg-disc{top:6px;left:0;right:auto}
.wide .lg-band{bottom:4px}
.wide #lgband{flex-direction:column;flex-wrap:nowrap;gap:0;align-items:flex-start}
.wide .lgb{padding:0 7px 0 3px;font-size:10px;line-height:1.3}
.vert .ind .name{font-size:11.5px}
svg{display:block;width:100%;height:auto;font-family:var(--font)}
.flow{fill:none;stroke:var(--flow);transition:stroke .2s,opacity .2s}
.dim .flow{opacity:.45}
.ind.on .flow{stroke:var(--flow-hi);opacity:1}
.ind .name{fill:var(--ink);font-size:11px;font-weight:700;text-anchor:middle}
.dim .ind:not(.on) .name{fill:var(--ink-faint)}
.dim .ind:not(.on) .stack{opacity:.5}
.stack{transition:opacity .2s}
.band{transition:opacity .2s}
.bandsel .band:not(.sel){opacity:.16}
.cnt,.pct{font-size:11px;font-weight:700;fill:var(--ink);paint-order:stroke;stroke:var(--bg);stroke-width:4px;stroke-linejoin:round;font-variant-numeric:tabular-nums}
.pct{text-anchor:middle;opacity:0}
.bandsel .pct{opacity:1}
.cnt{opacity:0}
.ind.on .cnt{opacity:1}
.hit{fill:transparent;cursor:pointer}
.sexlabel{font-size:30px;fill:var(--ink-faint);letter-spacing:.08em}
#zoom{position:fixed;inset:0;z-index:10;display:flex;align-items:center;justify-content:center;padding:12px;background:color-mix(in srgb,var(--bg) 88%,transparent);overflow:auto}
#zoom[hidden]{display:none}
#zcard > *{flex-shrink:0}
#zcard{background:var(--panel);border:1px solid var(--line);border-radius:12px;box-shadow:0 12px 48px rgba(0,0,0,.18);padding:18px 20px 14px;width:min(800px,100%);max-height:100%;overflow:auto;display:flex;flex-direction:column;gap:10px;transform-origin:0 0}
.zhead{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
#zname{font-size:20px;margin:0;font-weight:700;line-height:1.35}
#zmeta{margin:0;font-size:12px;color:var(--ink-soft)}
#zclose{width:36px;height:36px;border-radius:18px;padding:0;font-size:20px;line-height:1;flex:none}
#zstats{display:flex;flex-wrap:wrap;gap:6px 32px;margin:0;font-variant-numeric:tabular-nums}
#zstats div{display:flex;flex-direction:column}
#zstats dt{font-size:11px;color:var(--ink-soft)}
#zstats dd{margin:0;font-size:18px;font-weight:700;line-height:1.3}
#zstats dd small{font-size:11.5px;font-weight:500;color:var(--ink-soft);margin-left:10px}
#zsvg{display:block;width:100%;height:auto}
#zsvg text{fill:var(--ink);font-variant-numeric:tabular-nums}
#zsvg .zl{font-weight:500}
#zsvg .zp{font-weight:700}
#zsvg .zhd{font-size:11px;fill:var(--ink-soft)}
#zlegend{margin:0;font-size:11px;color:var(--ink-soft)}
#ztop h3{font-size:12px;margin:0 0 4px;font-weight:700}
#ztop dl{display:grid;grid-template-columns:repeat(3,1fr);gap:6px 18px;margin:0;font-variant-numeric:tabular-nums}
#ztop dl div{display:flex;flex-direction:column}
#ztop dt{font-size:10.5px;color:var(--ink-soft)}
#ztop dd{margin:0;font-size:12.5px}
#ztop dd span{display:inline-block;font-size:10.5px;color:var(--ink-soft);margin-right:6px}
@media (max-width:600px){#ztop dl{grid-template-columns:repeat(2,1fr)}}
.zlead{stroke:var(--ink-faint);stroke-width:1}
.zctl{display:flex;flex-wrap:wrap;gap:8px 14px;align-items:center;justify-content:space-between;border-top:1px solid var(--line);padding-top:12px;font-size:12.5px}
.zyear{display:flex;align-items:center;gap:6px}
.zyear b{font-variant-numeric:tabular-nums;min-width:5.2em;text-align:center}
.zyear button{padding:4px 10px}
button:disabled{opacity:.35;cursor:default}
.ind{cursor:pointer}
footer{font-size:11.5px;color:var(--ink-soft);display:flex;flex-wrap:wrap;gap:10px 28px;justify-content:space-between;align-items:flex-end}
.fnote{display:flex;flex-direction:column;gap:2px;flex:1 1 420px}
.credit{margin-left:auto;white-space:nowrap;font-size:12.5px;color:var(--ink)}
footer a{color:inherit}
@media (prefers-reduced-motion: reduce){*{transition:none !important}}
