:root {
  --bg: #f6f6fb;
  --bg2: #ffffff;
  --card: rgba(255,255,255,.72);
  --line: rgba(20,20,60,.09);
  --text: #15151f;
  --muted: #646478;
  --accent: #6d5efc;
  --accent2: #00b3a4;
  --shu: #6d5efc;
  --san: #ef6b3a;
  --shadow: 0 1px 2px rgba(20,20,60,.04), 0 8px 30px rgba(20,20,60,.06);
  --r: 18px;
  --ease: cubic-bezier(.2,.8,.2,1);
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0c14; --bg2: #14141f; --card: rgba(26,26,40,.66); --line: rgba(255,255,255,.08);
    --text: #ececf4; --muted: #9a9ab2; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 40px rgba(0,0,0,.35);
    --accent: #8b7fff;
  }
}
:root[data-theme="dark"] {
  --bg: #0c0c14; --bg2: #14141f; --card: rgba(26,26,40,.66); --line: rgba(255,255,255,.08);
  --text: #ececf4; --muted: #9a9ab2; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 40px rgba(0,0,0,.35);
  --accent: #8b7fff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 15px; line-height: 1.75; font-feature-settings: "palt"; min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1,h2,h3 { line-height: 1.3; letter-spacing: .01em; margin: 0; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* 背景の漂う光 */
.bg-orbs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-orbs span { position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; filter: blur(80px); opacity: .22; animation: drift 28s var(--ease) infinite alternate; }
.bg-orbs span:nth-child(1) { background: var(--accent); top: -20vmax; left: -10vmax; }
.bg-orbs span:nth-child(2) { background: var(--accent2); bottom: -25vmax; right: -15vmax; animation-delay: -9s; }
.bg-orbs span:nth-child(3) { background: var(--san); top: 30vh; left: 45vw; width: 26vmax; height: 26vmax; opacity: .1; animation-delay: -16s; }
@keyframes drift { to { transform: translate(6vmax, 4vmax) scale(1.12); } }

/* ヘッダー */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 20px;
  padding: 12px max(16px, calc((100vw - 1180px)/2)); backdrop-filter: saturate(1.6) blur(16px);
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
  background: color-mix(in srgb, var(--bg) 72%, transparent); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 17px; color: var(--accent); }
.brand span { color: var(--text); }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav a { padding: 6px 12px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; transition: .2s var(--ease); }
.nav a:hover { color: var(--text); background: var(--line); }
.nav a.on { color: var(--bg2); background: var(--text); }
.actions { display: flex; gap: 6px; }
.icon-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card); padding: 7px 10px; border-radius: 12px; cursor: pointer; color: var(--muted); transition: .2s var(--ease); }
.icon-btn:hover { color: var(--text); transform: translateY(-1px); }
kbd { font: 11px/1 ui-monospace, monospace; border: 1px solid var(--line); border-radius: 5px; padding: 2px 5px; }

main { max-width: 1180px; margin: 0 auto; padding: 28px 16px 60px; outline: none; }
.foot { max-width: 1180px; margin: 0 auto; padding: 24px 16px 48px; color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--line); }
.foot a { color: var(--accent); }

/* 共通部品 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.pad { padding: 22px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.g3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.g4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.sec { margin-top: 44px; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sec-h h2 { font-size: 21px; }
.sec-h a, .link { color: var(--accent); font-weight: 600; font-size: 14px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--line); white-space: nowrap; }
.chip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.badge { display: inline-block; padding: 1px 9px; border-radius: 6px; font-size: 12px; font-weight: 700; color: #fff; }
.badge.shu { background: var(--shu); } .badge.san { background: var(--san); }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--line); gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 6px 14px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--muted); transition: .2s var(--ease); }
.seg button.on { background: var(--bg2); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.input { width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); font: inherit; outline: none; transition: border-color .2s; }
.input:focus { border-color: var(--accent); }
select.input { width: auto; }
.empty { padding: 34px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r); }
.sources { font-size: 12px; color: var(--muted); word-break: break-all; }
.sources a { color: var(--accent); }
.sources ol { padding-left: 18px; margin: 6px 0 0; }

/* 出現アニメーション */
.rv { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); transition-delay: calc(var(--i, 0) * 45ms); }
.rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .rv { opacity: 1; transform: none; transition: none; } .bg-orbs span { animation: none; } }
::view-transition-old(root) { animation: .18s ease both vt-out; }
::view-transition-new(root) { animation: .32s var(--ease) both vt-in; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }

.loading { display: flex; gap: 8px; justify-content: center; padding: 120px 0; }
.loading span { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: bounce 1s infinite ease-in-out; }
.loading span:nth-child(2) { animation-delay: .15s; } .loading span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 50% { transform: translateY(-12px); opacity: .5; } }

/* ヒーロー */
.hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; align-items: center; padding: 26px 0 8px; }
.hero h1 { font-size: clamp(32px, 5.4vw, 58px); font-weight: 900; letter-spacing: -.01em; }
.hero h1 em { font-style: normal; background: linear-gradient(100deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); font-size: 16px; max-width: 34em; }
.cd { position: relative; overflow: hidden; }
.cd::after { content: ""; position: absolute; inset: -40%; background: conic-gradient(from 0deg, transparent, color-mix(in srgb, var(--accent) 22%, transparent), transparent 30%); animation: spin 9s linear infinite; z-index: -1; }
@keyframes spin { to { transform: rotate(1turn); } }
.cd-num { font-size: 64px; font-weight: 900; line-height: 1; letter-spacing: -.03em; }
.cd-num small { font-size: 18px; font-weight: 700; margin-left: 4px; color: var(--muted); }
.cd-list { display: grid; gap: 8px; margin-top: 14px; }
.cd-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; padding-top: 8px; border-top: 1px solid var(--line); }
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; } }

/* 議席図 */
.hemi { width: 100%; height: auto; display: block; }
.hemi circle { transform-box: fill-box; transform-origin: center; transform: scale(0); transition: transform .5s var(--ease); }
.hemi.in circle { transform: scale(1); }
.hemi .center { font-weight: 900; fill: var(--text); }
.hemi .sub { fill: var(--muted); font-size: 11px; }
.legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 14px; margin-top: 10px; }
.legend a { display: flex; align-items: center; gap: 8px; font-size: 13.5px; padding: 3px 6px; border-radius: 8px; transition: background .2s; }
.legend a:hover { background: var(--line); }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend b { margin-left: auto; }

/* 横積み棒 */
.stack { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--line); }
.stack span { height: 100%; width: 0; transition: width .9s var(--ease); }
.stack.in span { width: var(--w); }
.stack.big { height: 18px; border-radius: 8px; }
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 9em 1fr 4em; align-items: center; gap: 10px; font-size: 13.5px; }
.bar-row .track { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar-row .fill { height: 100%; width: 0; border-radius: 999px; transition: width 1s var(--ease); }
.in .bar-row .fill, .bars.in .fill { width: var(--w); }
.bar-row b { text-align: right; }

/* 政党カード */
.pcard { position: relative; overflow: hidden; display: block; padding: 20px; transition: transform .3s var(--ease), box-shadow .3s; }
.pcard:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(20,20,60,.14); }
.pcard::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--c); }
.pcard .glow { position: absolute; width: 180px; height: 180px; right: -60px; top: -60px; border-radius: 50%; background: var(--c); opacity: .12; filter: blur(30px); transition: opacity .3s; }
.pcard:hover .glow { opacity: .28; }
.pcard h3 { font-size: 18px; display: flex; align-items: center; gap: 8px; }
.pcard .seats { display: flex; gap: 14px; margin: 8px 0 10px; font-size: 13px; color: var(--muted); }
.pcard .seats b { font-size: 22px; color: var(--text); margin-right: 2px; }
.pcard p { font-size: 13.5px; color: var(--muted); margin: 0 0 10px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); flex: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 22%, transparent); }

/* 政治的位置マップ */
.compass { width: 100%; height: auto; display: block; }
.compass .ax { stroke: var(--line); stroke-width: 1.5; }
.compass text { fill: var(--muted); font-size: 11px; }
.compass .pt { transition: transform .9s var(--ease); cursor: pointer; }
.compass .pt circle { stroke: var(--bg2); stroke-width: 2; opacity: .88; transition: opacity .2s; }
.compass .pt:hover circle { opacity: 1; }
.compass .pt text { fill: var(--text); font-weight: 700; font-size: 12px; }

/* 選挙一覧 */
.era { margin-top: 30px; }
.era h3 { font-size: 14px; color: var(--muted); font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.era h3::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.erow { display: grid; grid-template-columns: 92px 1fr 220px 64px; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 14px; transition: background .2s, transform .25s var(--ease); }
.erow:hover { background: var(--card); transform: translateX(4px); }
.erow .d { font-weight: 800; font-size: 15px; }
.erow .d small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.erow .t { min-width: 0; }
.erow .t div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.erow .to { text-align: right; font-size: 12.5px; color: var(--muted); }
@media (max-width: 720px) { .erow { grid-template-columns: 78px 1fr; } .erow .stack, .erow .to { grid-column: 2; } .erow .to { text-align: left; } }

/* 詳細ヘッダー */
.dhead { position: relative; overflow: hidden; padding: 30px; }
.dhead::before { content: ""; position: absolute; inset: 0; background: radial-gradient(600px 240px at 0% 0%, color-mix(in srgb, var(--c, var(--accent)) 26%, transparent), transparent 70%); pointer-events: none; }
.dhead > * { position: relative; }
.dhead h1 { font-size: clamp(26px, 4vw, 40px); font-weight: 900; margin: 6px 0 10px; }
.facts { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 14px; }
.fact { font-size: 12.5px; color: var(--muted); }
.fact b { display: block; font-size: 20px; color: var(--text); font-weight: 800; }
.crumb { font-size: 13px; color: var(--muted); }
.crumb a:hover { color: var(--accent); }

/* タブ */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.tab { border: 1px solid var(--line); background: var(--card); padding: 7px 14px; border-radius: 999px; cursor: pointer; font-weight: 700; font-size: 13.5px; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; transition: .2s var(--ease); }
.tab.on { background: var(--c, var(--text)); border-color: transparent; color: #fff; }
.tab i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.tab.on i { background: #fff; }

/* 公約 */
.pillar { padding: 16px 18px; border-radius: 14px; background: var(--bg2); border: 1px solid var(--line); }
.pillar h4 { margin: 0 0 6px; font-size: 14.5px; display: flex; gap: 8px; align-items: center; }
.pillar h4::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--c, var(--accent)); }
.pillar ul { margin: 0; padding-left: 1.2em; font-size: 14px; }
.pillar li { margin: 3px 0; }
mark { background: color-mix(in srgb, #ffd23f 60%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }
.slogan { font-size: 20px; font-weight: 800; margin: 2px 0 4px; }

/* アコーディオン */
details.acc { border-bottom: 1px solid var(--line); }
details.acc > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 14px 4px; font-weight: 700; }
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary::after { content: "+"; margin-left: auto; font-size: 20px; color: var(--muted); transition: transform .3s var(--ease); }
details.acc[open] > summary::after { transform: rotate(45deg); }
details.acc .body { padding: 0 4px 18px; animation: vt-in .35s var(--ease); }

/* タイムライン */
.tl { position: relative; margin: 0; padding: 0 0 0 22px; list-style: none; }
.tl::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--c, var(--accent)), transparent); }
.tl li { position: relative; padding: 0 0 16px; }
.tl li::before { content: ""; position: absolute; left: -21px; top: 7px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg2); border: 3px solid var(--c, var(--accent)); }
.tl time { font-size: 12.5px; color: var(--muted); font-weight: 700; display: block; }

/* 位置ゲージ */
.gauge { margin: 10px 0 16px; }
.gauge .lab { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.gauge .rail { position: relative; height: 8px; border-radius: 999px; background: linear-gradient(90deg, #3b82f6, #a1a1aa, #ef4444); opacity: .85; margin-top: 4px; }
.gauge .knob { position: absolute; top: 50%; width: 18px; height: 18px; border-radius: 50%; background: var(--bg2); border: 4px solid var(--c, var(--text)); transform: translate(-50%, -50%); left: 50%; transition: left 1.1s var(--ease); }

/* 議員 */
.mcard { display: flex; gap: 14px; padding: 16px; align-items: center; transition: transform .3s var(--ease); }
.mcard:hover { transform: translateY(-3px); }
.avatar { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 19px; background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 55%, #000)); flex: none; }
.avatar.lg { width: 84px; height: 84px; font-size: 34px; border-radius: 26px; }
.mcard h3 { font-size: 16px; }
.mcard .small { line-height: 1.5; }

/* 推移 */
.trend { width: 100%; height: auto; display: block; }
.trend rect { transition: height .8s var(--ease), y .8s var(--ease); }
.trend text { fill: var(--muted); font-size: 10px; }

/* 検索 */
.search { width: min(640px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 20px; padding: 0; background: var(--bg2); color: var(--text); box-shadow: 0 30px 80px rgba(0,0,0,.3); margin-top: 12vh; }
.search::backdrop { background: rgba(10,10,20,.35); backdrop-filter: blur(4px); }
.search[open] { animation: vt-in .25s var(--ease); }
.search input { width: 100%; border: 0; border-bottom: 1px solid var(--line); padding: 18px 20px; font: inherit; font-size: 17px; background: none; color: inherit; outline: none; }
.search ul { list-style: none; margin: 0; padding: 8px; max-height: 56vh; overflow: auto; }
.search li a { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; font-size: 14px; }
.search li a:hover, .search li a.sel { background: var(--line); }
.search li .k { font-size: 11px; color: var(--muted); border: 1px solid var(--line); padding: 1px 7px; border-radius: 6px; flex: none; }
.search li .x { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 比較 */
.cmp { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(280px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x mandatory; }
.cmp > * { scroll-snap-align: start; }
.cmp .col { padding: 18px; }
.cmp .col h3 { display: flex; gap: 8px; align-items: center; font-size: 16px; margin-bottom: 4px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 16px 0; }
.toolbar .input { flex: 1; min-width: 200px; }
.hit-none { opacity: .35; }

.prose { font-size: 15px; }
.prose p { margin: 0 0 10px; }
.kv { display: grid; grid-template-columns: 7em 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.notice { font-size: 12.5px; color: var(--muted); padding: 10px 14px; border-radius: 12px; background: var(--line); }

/* スマホ: ナビを下部タブバーに */
@media (max-width: 720px) {
  .topbar { gap: 10px; backdrop-filter: none; -webkit-backdrop-filter: none; background: color-mix(in srgb, var(--bg) 94%, transparent); }
  .brand { flex: 1; }
  .nav {
    position: fixed; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 30;
    justify-content: space-around; padding: 6px; border-radius: 20px; border: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg2) 82%, transparent); backdrop-filter: saturate(1.6) blur(18px);
    -webkit-backdrop-filter: saturate(1.6) blur(18px); box-shadow: 0 10px 30px rgba(0,0,0,.18);
  }
  .nav a { padding: 8px 10px; font-size: 13px; }
  .icon-btn kbd { display: none; }
  body { padding-bottom: 76px; }
  .dhead { padding: 22px; }
  .bar-row { grid-template-columns: 6.5em 1fr 3em; }
}

/* 与党・野党の枠 */
.side { margin-top: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); border-left: 4px solid var(--c); background: var(--bg2); }
.side-h { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; }
.side-h span b { font-size: 20px; }
.side .legend { margin-top: 6px; }
.majbar { position: relative; height: 8px; border-radius: 999px; background: var(--line); margin: 10px 0 4px; overflow: visible; }
.majbar span { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--accent); transition: width 1s var(--ease); }
.majbar.in span { width: var(--w); }
.majbar i { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text); }
.updated { font-size: 11.5px; color: var(--muted); white-space: nowrap; text-align: right; line-height: 1.3; }
.updated b { display: block; color: var(--text); font-size: 12.5px; }
@media (max-width: 720px) { .updated { display: none; } }

/* 議員の写真 */
img.avatar { object-fit: cover; object-position: center 20%; background: var(--line); padding: 0; border: 2px solid color-mix(in srgb, var(--c) 60%, transparent); }
.avatar.lg { width: 108px; height: 132px; border-radius: 22px; }
.mphoto { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: 180px; }
.mphoto figcaption { font-size: 10.5px; line-height: 1.4; color: var(--muted); text-align: center; word-break: break-all; }
.mphoto figcaption a { color: var(--accent); }
.sec-h { flex-wrap: wrap; }
#chSeg { flex-wrap: nowrap; }

/* 公約比較: 横移動の操作バー */
.cmp-nav { position: sticky; top: 58px; z-index: 5; display: grid; gap: 8px; padding: 10px 12px; margin-bottom: 12px; border-radius: 16px; border: 1px solid var(--line); background: color-mix(in srgb, var(--bg2) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.cmp-nav.no-scroll .cmp-ctrl { display: none; }
.cmp-jump { padding-bottom: 2px; }
.cmp-jump .tab { padding: 4px 11px; font-size: 12.5px; }
.cmp-ctrl { display: flex; align-items: center; gap: 10px; }
.cmp-ctrl .icon-btn { padding: 6px 14px; font-size: 16px; font-weight: 800; color: var(--text); }
.cmp-ctrl input[type=range] { flex: 1; accent-color: var(--accent); min-width: 80px; }
.cmp-pos { white-space: nowrap; min-width: 6.5em; text-align: right; }
.cmp { position: relative; mask-image: none; }
.cmp.more-right { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
.cmp.more-left.more-right { -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 85%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 85%, transparent); }
.cmp.more-left:not(.more-right) { -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%); mask-image: linear-gradient(90deg, transparent, #000 6%); }
@media (max-width: 720px) { .cmp-nav { top: 54px; } .cmp-pos { min-width: 0; } }

/* 参院の色（折れ線のコントラスト確保のため調整） */
:root { --san: #e0612f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --san: #e2622f; } }
:root[data-theme="dark"] { --san: #e2622f; }

/* 公約ページ群のサブタブ */
.subnav { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.subnav a { padding: 7px 14px; border-radius: 10px; font-weight: 700; font-size: 13.5px; color: var(--muted); transition: .2s var(--ease); }
.subnav a.on { background: var(--bg2); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.12); }

/* 投票率グラフ */
.turnout { margin-bottom: 8px; }
.legend-inline { display: flex; gap: 14px; font-size: 13px; color: var(--muted); }
.legend-inline i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.tchart { position: relative; }
.tchart svg { width: 100%; height: auto; display: block; }
.tchart .grid { stroke: var(--line); stroke-width: 1; }
.tchart .ax { fill: var(--muted); font-size: 11px; }
.tchart .tl-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.tchart circle { stroke: var(--bg2); stroke-width: 1.5; }
.tchart .tl-end { fill: var(--text); font-size: 11.5px; font-weight: 700; }
.tchart .xhair { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.tchart .hit { fill: transparent; cursor: pointer; }
.ttip { position: absolute; pointer-events: none; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: 12.5px; box-shadow: var(--shadow); white-space: nowrap; transform: translateY(-100%); }
.ttip div { display: flex; align-items: center; gap: 6px; }
.ttip i { width: 8px; height: 8px; border-radius: 50%; }
.ttip b { margin-left: 8px; }
.ttable { width: 100%; border-collapse: collapse; margin-top: 8px; }
.ttable th, .ttable td { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--line); }

/* 進捗・主張の変化 */
.stat { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; color: var(--sc); background: color-mix(in srgb, var(--sc) 14%, transparent); border: 1px solid color-mix(in srgb, var(--sc) 40%, transparent); white-space: nowrap; }
.stat::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--sc); }
.stat-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 14px; font-size: 13px; }
.stat-legend > * { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px; border-radius: 8px; }
.stat-legend a.on { background: var(--line); }
.pbar { display: grid; gap: 6px; padding: 8px; border-radius: 12px; transition: background .2s; }
.pbar:hover { background: var(--line); }
.prog { border-top: 3px solid var(--c); }
.prog-h { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.prog-t { font-size: 15.5px; margin-top: 10px; line-height: 1.5; }
.gap-cols { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; margin-top: 12px; align-items: start; }
.gap-cols > div:not(.gap-arrow) { padding: 12px 14px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); }
.gap-cols p { margin: 4px 0; font-size: 14px; }
.gap-arrow { align-self: center; font-size: 22px; font-weight: 900; color: var(--c); }
@media (max-width: 720px) { .gap-cols { grid-template-columns: 1fr; } .gap-arrow { transform: rotate(90deg); justify-self: center; } }
.src-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-size: 13px; word-break: break-all; }
.src-list > li > a { color: var(--accent); }
.h2s { font-size: 18px; margin-bottom: 10px; }
.kv-wide { grid-template-columns: 6em 1fr; }
.pcard .abbr { margin-left: auto; font-size: 11.5px; font-weight: 700; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; }

/* 選挙区ごとの結果 */
.dtools { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: start; }
@media (max-width: 860px) { .dtools { grid-template-columns: 1fr; } }
.muni { position: relative; }
.muni-res { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; max-height: 340px; overflow: auto; }
.muni-res:empty { display: none; }
.muni-res li { padding: 10px 12px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); font-size: 14px; }
.muni-res .chip { gap: 4px; }
.muni-res .chip .badge { padding: 0 5px; font-size: 10.5px; }
.dtable { display: grid; gap: 2px; }
.drow { border-bottom: 1px solid var(--line); }
.drow > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 7.5em 7.5em 1fr minmax(120px, 1.2fr); gap: 12px; align-items: center; padding: 10px 4px; font-size: 13.5px; }
.drow > summary::-webkit-details-marker { display: none; }
.drow > summary:hover { background: var(--line); border-radius: 10px; }
.drow[open] { background: color-mix(in srgb, var(--accent) 5%, transparent); border-radius: 12px; padding: 0 8px 12px; }
.drow.flash > summary { animation: flash 1.6s ease 2; }
@keyframes flash { 50% { background: color-mix(in srgb, var(--accent) 22%, transparent); } }
.dn { font-weight: 800; }
.dt { position: relative; padding-left: 4px; }
.dt .tbar { position: absolute; left: 0; top: 50%; height: 18px; transform: translateY(-50%); border-radius: 5px; background: color-mix(in srgb, var(--accent) 20%, transparent); z-index: -1; }
.dw { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drow .stack span { display: block; height: 100%; }
.drow .stack span + span { margin-left: 2px; }
.sw { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
@media (max-width: 720px) { .drow > summary { grid-template-columns: 1fr auto; } .drow .dw, .drow > summary .stack { grid-column: 1 / -1; } }

/* 公式リンク・動画の出典 */
.olinks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.olinks a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg2); font-size: 12.5px; font-weight: 700; transition: transform .2s var(--ease), border-color .2s; }
.olinks a:hover { transform: translateY(-2px); border-color: var(--c, var(--accent)); }
.vtag { display: inline-block; font-size: 11px; font-weight: 800; color: #fff; background: #d63b3b; border-radius: 5px; padding: 0 6px; }
.gap-cols > div { min-width: 0; overflow-wrap: anywhere; }
.gap, .prog { min-width: 0; overflow-wrap: anywhere; }
.grid > * { min-width: 0; }
.tscroll { overflow-x: auto; }
.tscroll .ttable td, .tscroll .ttable th { white-space: nowrap; }
.drow .ttable { font-size: 13px; }
.tchart .ptitle { fill: var(--text); font-size: 11.5px; font-weight: 700; }
.ttip span { margin-left: 8px; }
.olinks a.olink-from { border: 0; background: none; color: var(--muted); font-weight: 600; font-size: 11.5px; }
.dtable, .drow { min-width: 0; max-width: 100%; }
.drow { overflow-wrap: anywhere; }
.drow > summary { min-width: 0; }
.drow > summary > * { min-width: 0; }

/* 選挙区ごとの結果（たたみ式） */
.dsec > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; padding: 18px 22px; }
.dsec > summary::-webkit-details-marker { display: none; }
.dsec > summary h2 { font-size: 21px; }
.dsec-btn { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--accent); display: inline-flex; align-items: center; gap: 6px; }
.dsec-btn::after { content: "▾"; transition: transform .3s var(--ease); }
.dsec[open] .dsec-btn::after { transform: rotate(180deg); }
.dsec > summary:hover .dsec-btn { text-decoration: underline; }

/* 最終更新（更新履歴へのリンク） */
.updated a, #updatedFoot a { color: inherit; }
.updated a:hover b, #updatedFoot a:hover { color: var(--accent); }

/* 論点マップ */
.ptime { position: relative; display: flex; align-items: center; gap: 10px; margin: 16px 0 26px; }
.ptime input[type=range] { flex: 1; accent-color: var(--accent); }
.ptime #pplay { width: 38px; justify-content: center; color: var(--text); }
.ptime #plabel { white-space: nowrap; font-size: 13.5px; width: 101px; flex: none; }
.pticks { position: absolute; left: calc(38px + 10px + 8px); right: calc(101px + 10px + 8px); top: 26px; height: 14px; pointer-events: none; }
.pticks span { position: absolute; transform: translateX(-50%); font-size: 10px; color: var(--muted); white-space: nowrap; }
@media (max-width: 720px) { .pticks span { display: none; } .pticks span:first-child, .pticks span:last-child { display: block; } }
.pstage { margin-top: 8px; }
.pline { position: relative; padding: 0 30px; }
.paxis { position: relative; height: 10px; border-radius: 999px; background: linear-gradient(90deg, #2f6fd6, #a9a9b8 50%, #e0612f); opacity: .55; margin: 10px 0 4px; }
.ptick { position: absolute; top: 50%; transform: translate(-50%, -50%); }
.ptick i { display: block; width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--bg2); }
.pends { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 14px; }
.pfield { position: relative; transition: height .5s var(--ease); }
.pdot { position: absolute; transform: translate(-50%, 0); display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg2); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; transition: left .9s var(--ease), top .9s var(--ease), opacity .4s, box-shadow .2s; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.pdot i { width: var(--s, 14px); height: var(--s, 14px); border-radius: 50%; background: var(--c); flex: none; transition: width .6s var(--ease), height .6s var(--ease); }
.pdot:hover { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 40%, transparent); z-index: 2; }
.pdot.gone { opacity: 0; pointer-events: none; }
.pmap { position: relative; width: 100%; aspect-ratio: 2.1; margin: 6px 0 0; border-radius: 12px; border: 1px solid var(--line); overflow: hidden; }
/* 端の点や名前がはみ出さないよう、目盛りと点の領域を内側に取る */
.pmap .pgrid, .pmap .pfield { position: absolute; inset: 9% 8%; }
@media (max-width: 1000px) { .pmap { aspect-ratio: 1.5; } .pmap .pgrid, .pmap .pfield { inset: 9% 12%; } }
.pmap .pgrid { background: linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 25%, linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 25% 100%; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pmap .pdot { transform: translate(-50%, -50%); }
.paxlabel { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.paxlabel b { color: var(--text); }
.pxrow { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: baseline; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.pxrow .pl-x1 { text-align: right; }
.pxrow b { color: var(--text); font-size: 12px; }
@media (max-width: 720px) { .pmap { aspect-ratio: 0.95; } .pmap .pgrid, .pmap .pfield { inset: 8% 16%; } .pdot { font-size: 11px; padding: 2px 7px 2px 3px; } }
.pnull { margin-top: 10px; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }
.pdetail { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); border-left: 4px solid var(--c); font-size: 14px; }
.pval { display: inline-block; padding: 0 8px; border-radius: 6px; font-weight: 800; background: color-mix(in srgb, var(--pc) 22%, transparent); }
.ptable { border-collapse: separate; border-spacing: 3px; font-size: 12.5px; }
.ptable th { font-weight: 700; white-space: nowrap; text-align: left; padding: 4px 6px; color: var(--muted); }
.ptable tbody th { color: var(--text); }
.pcell { min-width: 44px; text-align: center; padding: 6px 4px; border-radius: 7px; font-weight: 800; cursor: pointer; background: color-mix(in srgb, var(--pc) 45%, transparent); transition: transform .15s; }
.pcell:hover { transform: scale(1.08); }
.pnone { background: transparent; }

/* 論点マップの説明窓（ポップオーバー） */
.pop { position: absolute; z-index: 60; width: min(380px, calc(100vw - 16px)); padding: 14px 16px 12px; border-radius: 14px; background: var(--bg2); border: 1px solid var(--line); border-top: 4px solid var(--c); box-shadow: 0 18px 50px rgba(0,0,0,.28); font-size: 14px; animation: pop-in .18s var(--ease); }
.pop::after { content: ""; position: absolute; left: var(--ax, 50%); width: 12px; height: 12px; background: var(--bg2); border: 1px solid var(--line); transform: translateX(-50%) rotate(45deg); }
.pop.below::after { top: -9px; border-right: 0; border-bottom: 0; border-top: 0; border-left: 0; background: var(--c); width: 10px; height: 10px; top: -8px; }
.pop.above::after { bottom: -7px; border-left: 0; border-top: 0; }
.pop .small { margin-top: 4px; }
.pop-x { position: absolute; right: 8px; top: 6px; border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; line-height: 1; padding: 4px; }
.pop.sheet { position: fixed; left: 8px; right: 8px; bottom: 84px; top: auto; width: auto; animation: sheet-in .25s var(--ease); }
.pop.sheet::after { display: none; }
@keyframes pop-in { from { opacity: 0; transform: translateY(4px) scale(.98); } }
@keyframes sheet-in { from { opacity: 0; transform: translateY(30px); } }
.pop-anchor { outline: 3px solid var(--accent); outline-offset: 2px; }
/* 推移表を横に動かしても党名の列は残す */
.ptable tbody th, .ptable thead th:first-child { position: sticky; left: 0; z-index: 1; background: var(--bg2); }

/* 検索ウィンドウ: 横幅を画面の約8割に広げ、名前は1行で表示 */
.search { width: min(80vw, 1280px); max-width: none; }
@media (max-width: 720px) { .search { width: calc(100vw - 24px); } }
.search li a > span:nth-child(2) { white-space: nowrap; flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.search li .x { flex: 1; min-width: 0; }
/* 片方の論点だけ判定のある党（地図の外側の余白に破線で表示） */
.pmap { --gx: 46px; --gy: 30px; }
.pdot.partial { border-style: dashed; border-color: var(--muted); opacity: .85; }
@media (max-width: 1000px) { .pmap .pgrid, .pmap .pfield { inset: 8% 12% 13% 14%; } }
@media (max-width: 720px) { .pmap { --gx: 26px; --gy: 26px; } .pmap .pgrid, .pmap .pfield { inset: 8% 15% 15% 17%; } }
/* 次の選挙: きょう・あすが投票日の印 */
.vote-today, .vote-soon { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 800; color: #fff; background: var(--san); }
.vote-soon { background: var(--accent); }
.vote-today::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: bounce 1.2s infinite; }
.card.is-today { border-color: color-mix(in srgb, var(--san) 60%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--san) 22%, transparent), var(--shadow); }
.ures { margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); }
.ures-w { font-size: 17px; margin-top: 2px; }
/* 2つの論点の地図: 広い画面では縦軸の説明を左の列に */
.pmapwrap { display: grid; grid-template-columns: 1fr; }
.pycol { display: none; }
@media (min-width: 1001px) {
  .pmapwrap { grid-template-columns: 96px 1fr; gap: 10px; margin-top: 6px; }
  .pmapwrap .pmap { margin: 0; }
  .pycol { display: block; position: relative; font-size: 12.5px; color: var(--muted); text-align: right; }
  .pycol span { position: absolute; right: 0; left: 0; transform: translateY(-50%); line-height: 1.35; }
  .py-top { top: 9%; } .py-bot { top: 91%; } .py-mid { top: 50%; }
  .py-mid b { color: var(--text); font-size: 13px; }
  .paxlabel { display: none; }
  .pxrow { margin-left: 106px; }
}
/* 全国会議員の一覧 */
.roster th { cursor: pointer; white-space: nowrap; position: sticky; top: 0; background: var(--bg2); }
.roster th.sorted { color: var(--accent); }
.roster td { vertical-align: top; }
.roster .chip { font-size: 11.5px; }
.retired-chip { background: color-mix(in srgb, var(--muted) 22%, transparent); }

/* JavaScript が動く前に見える本文の要約（検索エンジン向け。画面の準備ができると置き換わる） */
.seo-static { max-width: 860px; color: var(--muted); font-size: 14px; }
.seo-static h1 { font-size: 28px; color: var(--text); margin-bottom: 10px; }
.seo-static h2 { font-size: 17px; color: var(--text); margin: 20px 0 6px; }
.seo-static a { color: var(--accent); }
