/* ===== 色とトークン ===== */
:root {
  --bg: #fff8ec;
  --dot: #f5ecdd;
  --card: #ffffff;
  --text: #22252b;
  --muted: #555c66;
  --line: #cfc7b8;
  --soft-line: #e6dfd2;
  --shadow: rgba(60, 45, 20, .10);
  --link: #3346c4;
  --fact: #2b7a3d;
  --fact-soft: #e3f6e6;
  --claim: #8a5300;
  --claim-soft: #fff0d1;
  --s1: #2a6fdb;
  --s2: #d9731a;
  --grid: #ece6da;
  --axis: #bdb6a8;
  /* テーマ色 */
  --c0: #5c7cfa; --c1: #ff6b6b; --c2: #ff922b; --c3: #fcc419; --c4: #51cf66;
  --c5: #339af0; --c6: #845ef7; --c7: #f06595; --c8: #20c997;
  --tint: 17%;
  --tint-base: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17181c;
    --dot: #22242a;
    --card: #202228;
    --text: #eceae6;
    --muted: #a9b0ba;
    --line: #3f434b;
    --soft-line: #34373e;
    --shadow: rgba(0, 0, 0, .35);
    --link: #9db0ff;
    --fact: #8fd19e;
    --fact-soft: #1f3324;
    --claim: #f0c46c;
    --claim-soft: #3a2f17;
    --s1: #5f9ff0;
    --s2: #d97c2b;
    --grid: #303238;
    --axis: #4a4e57;
    --tint: 20%;
    --tint-base: #202228;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1.5px, transparent 1.5px);
  background-size: 26px 26px;
  color: var(--text);
  font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Meiryo", sans-serif;
  line-height: 1.8;
  font-size: 16px;
}
a { color: var(--link); text-underline-offset: 3px; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }

/* テーマ色の割り当て */
.c0 { --t: var(--c0); } .c1 { --t: var(--c1); } .c2 { --t: var(--c2); } .c3 { --t: var(--c3); }
.c4 { --t: var(--c4); } .c5 { --t: var(--c5); } .c6 { --t: var(--c6); } .c7 { --t: var(--c7); } .c8 { --t: var(--c8); }

/* ===== アクセシビリティ ===== */
.skip { position: absolute; left: -9999px; top: 0; background: var(--card); color: var(--link); padding: 8px 12px; z-index: 100; border: 1.5px solid var(--line); border-radius: 10px; }
.skip:focus { left: 8px; top: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a:focus-visible, button:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--c0); outline-offset: 3px; border-radius: 6px; }

/* ===== ヘッダー ===== */
.topbar { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px; padding-bottom: 8px; }
.logo { color: var(--text); text-decoration: none; font-size: .95rem; display: inline-flex; align-items: center; gap: 8px; line-height: 1.3; }
.logo b { font-weight: 800; }
.logo-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--c3); border: 1.5px solid var(--line); font-size: 1.1rem; }
.pill-link { flex: none; font-weight: 700; font-size: .88rem; text-decoration: none; color: #22252b; background: var(--c3); border: 1.5px solid var(--line); border-radius: 999px; padding: 4px 14px; box-shadow: 0 1px 6px var(--shadow); }
.themes-nav ul { list-style: none; margin: 0 auto; padding-top: 4px; padding-bottom: 10px; display: flex; gap: 8px; overflow-x: auto; white-space: nowrap; scrollbar-width: thin; }
.themes-nav a {
  display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: .85rem; font-weight: 700;
  text-decoration: none; color: var(--text);
  background: color-mix(in srgb, var(--t) var(--tint), var(--tint-base));
  border: 2px solid transparent;
}
.themes-nav a:hover { border-color: var(--t); }
.themes-nav a[aria-current="page"] { border-color: var(--line); box-shadow: 0 1px 6px var(--shadow); }

/* ===== ヒーロー ===== */
.hero { padding: 40px 0 36px; border-bottom: 1px solid var(--line); }
.hero h1 { margin: 0 0 10px; font-weight: 700; line-height: 1.3; }
.hero .lead { margin: 0; font-size: 1.05rem; }
.home-hero {
  background: color-mix(in srgb, var(--c3) 22%, var(--tint-base));
}
.home-hero h1 { font-size: clamp(1.9rem, 6vw, 2.9rem); }
.kicker { display: inline-block; margin: 0 0 12px; font-weight: 800; font-size: .85rem; background: var(--card); border: 1.5px solid var(--line); border-radius: 999px; padding: 2px 12px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 14px; }
.updated { font-size: .85rem; color: var(--muted); margin: 0; }
.theme-hero { background: color-mix(in srgb, var(--t) var(--tint), var(--tint-base)); }
.theme-hero h1 { font-size: clamp(1.5rem, 5vw, 2.2rem); display: flex; align-items: center; gap: 12px; }
.hero-emoji { display: inline-grid; place-items: center; flex: none; width: 56px; height: 56px; border-radius: 16px; background: var(--card); border: 1.5px solid var(--line); box-shadow: 0 2px 9px var(--shadow); font-size: 1.8rem; }
.crumb { margin: 0 0 10px; font-size: .85rem; color: var(--muted); }
.badges { margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.badge { font-size: .82rem; font-weight: 700; background: var(--card); border: 1.5px solid var(--line); border-radius: 999px; padding: 1px 12px; }

/* ===== ボタン ===== */
.btn, a.button {
  display: inline-block; font-weight: 800; text-decoration: none; color: #22252b;
  background: var(--c3); border: 1.5px solid var(--line); border-radius: 999px;
  padding: 10px 22px; box-shadow: 0 3px 12px var(--shadow); transition: transform .08s, box-shadow .08s;
}
.btn:hover, a.button:hover { transform: translateY(-1px); box-shadow: 0 6px 16px var(--shadow); }
.btn:active, a.button:active { transform: translateY(0); }
.btn.big { background: #c2410c; border-color: #c2410c; color: #fff; font-size: 1.05rem; }
.btn.ghost { background: var(--card); color: var(--text); }
a.button[aria-disabled="true"] { background: var(--soft-line); color: var(--muted); box-shadow: none; pointer-events: none; }

/* ===== カード ===== */
main { padding-top: 28px; padding-bottom: 20px; }
.card {
  background: var(--card); border: 1.5px solid var(--line); border-radius: 20px;
  padding: 20px 22px; margin-bottom: 22px; box-shadow: 0 4px 15px var(--shadow);
}
.theme .card.block { border-top: 5px solid var(--t); }
h2 { font-size: 1.35rem; font-weight: 800; margin: 0 0 12px; }
h3 { font-size: 1.15rem; font-weight: 800; margin: 0 0 10px; display: inline-block; background: linear-gradient(transparent 60%, color-mix(in srgb, var(--t, var(--c3)) 30%, transparent) 60%); }
.note { font-size: .9rem; color: var(--muted); }
.legend span { margin-right: 10px; }
.none { color: var(--muted); font-size: .95rem; }

/* ===== トップのテーマカード ===== */
.home-themes h2 { font-size: 1.5rem; }
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; margin-bottom: 30px; }
.tcard {
  display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--text);
  background: color-mix(in srgb, var(--t) var(--tint), var(--tint-base));
  border: 1.5px solid var(--line); border-radius: 20px; padding: 18px; box-shadow: 0 4px 15px var(--shadow);
  transition: transform .1s, box-shadow .1s;
}
.tcard:hover { transform: translateY(-2px); box-shadow: 0 8px 20px var(--shadow); border-color: var(--t); }
.tcard:active { transform: translateY(0); }
.tcard-emoji { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--card); border: 1.5px solid var(--line); font-size: 1.6rem; }
.tcard-title { font-size: 1.15rem; font-weight: 800; }
.tcard-desc { font-size: .88rem; line-height: 1.6; flex: 1; }
.tcard-badge { align-self: flex-start; font-size: .78rem; font-weight: 800; background: var(--card); border: 1.5px solid var(--line); border-radius: 999px; padding: 0 10px; }

/* ===== タグ ===== */
.tag { display: inline-block; font-size: .75rem; font-weight: 800; padding: 0 8px; border-radius: 999px; margin-right: 6px; vertical-align: 1px; border: 1.5px solid currentColor; }
.tag.fact { background: var(--fact-soft); color: var(--fact); }
.tag.claim { background: var(--claim-soft); color: var(--claim); }
.tag.open { background: var(--fact-soft); color: var(--fact); }
.tag.closed { background: var(--soft-line); color: var(--muted); }

/* ===== ニュース・署名 ===== */
ul.news { padding-left: 0; list-style: none; margin: 0; }
ul.news li { padding: 10px 0; border-bottom: 2px dashed var(--soft-line); }
ul.news li:last-child { border-bottom: none; }
.date { display: inline-block; font-weight: 800; font-size: .82rem; margin-right: 8px; padding: 0 8px; border-radius: 6px; background: color-mix(in srgb, var(--t, var(--c3)) var(--tint), var(--tint-base)); }
.src { font-size: .85rem; }
.petition { border: 1.5px solid var(--line); border-radius: 14px; padding: 14px 16px; margin: 12px 0; background: var(--card); }
.petition .ptitle { font-weight: 800; }
.petition dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 8px 0 0; font-size: .88rem; }
.petition dt { color: var(--muted); }
.petition dd { margin: 0; }
.petition.closed { opacity: .85; border-style: dashed; }

/* ===== 署名一覧の表と絞り込み ===== */
.filters { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 6px; }
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; box-shadow: 0 2px 9px var(--shadow); }
.seg button { font: inherit; font-weight: 700; font-size: .9rem; padding: 6px 16px; min-height: 38px; border: 0; background: var(--card); color: var(--text); cursor: pointer; }
.seg button + button { border-left: 1.5px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--c3); color: #22252b; }
.selectlabel { font-size: .9rem; font-weight: 700; display: inline-flex; gap: 8px; align-items: center; }
.selectlabel select { font: inherit; font-size: .9rem; padding: 6px 10px; min-height: 38px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); color: var(--text); }
.tablewrap { overflow-x: auto; }
table.quick { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.quick th, table.quick td { border-bottom: 2px solid var(--soft-line); padding: 8px 6px; text-align: left; vertical-align: top; }
table.quick th { color: var(--muted); font-weight: 700; }
table.quick tr[hidden] { display: none; }
table.quick td:nth-child(4) { white-space: nowrap; font-variant-numeric: tabular-nums; }
table.quick td:first-child { white-space: nowrap; }
@media (max-width: 600px) {
  table.quick thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.quick, table.quick tbody { display: block; }
  table.quick tr { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; padding: 12px 0; border-bottom: 2px dashed var(--soft-line); }
  table.quick td { border: 0; padding: 0; }
  table.quick td:nth-child(2) { color: var(--muted); font-size: .85rem; align-self: center; }
  table.quick td:nth-child(3) { grid-column: 1 / -1; font-weight: 700; }
  table.quick td:nth-child(4)::before { content: "賛同 "; color: var(--muted); }
  table.quick td:nth-child(5)::before { content: "締切 "; color: var(--muted); }
  table.quick td:nth-child(4), table.quick td:nth-child(5) { font-size: .85rem; }
  table.quick td:nth-child(4) { grid-column: 1; }
  table.quick td:nth-child(5) { grid-column: 2; }
}

/* ===== グラフ ===== */
figure.chart { margin: 18px 0; padding: 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); }
figure.chart figcaption { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin-bottom: 6px; }
.chart-legend { display: flex; gap: 16px; font-size: .85rem; margin-bottom: 4px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: 0; }
.sw.s1 { background: var(--s1); } .sw.s2 { background: var(--s2); }
.chart-body { position: relative; }
.chart-body svg { width: 100%; height: auto; display: block; overflow: visible; touch-action: pan-y; font-family: inherit; }
.chart-body .grid { stroke: var(--grid); stroke-width: 1; }
.chart-body .axis { stroke: var(--axis); stroke-width: 1; }
.chart-body .tick { fill: var(--muted); font-size: 11px; }
.chart-body .dlabel { fill: var(--text); font-size: 12px; font-weight: bold; }
.chart-body .line { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart-body .line.s1 { stroke: var(--s1); } .chart-body .line.s2 { stroke: var(--s2); }
.chart-body .dot { stroke: var(--card); stroke-width: 2; }
.chart-body .dot.s1 { fill: var(--s1); } .chart-body .dot.s2 { fill: var(--s2); }
.chart-body .cross { stroke: var(--axis); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-body .bar { fill: var(--s1); }
.chart-body .bar.bar-hl { opacity: .6; }
.chart-body .bar.hover { opacity: .8; }
.chart-tip { position: absolute; pointer-events: none; background: var(--card); color: var(--text); border: 1.5px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: .82rem; line-height: 1.5; box-shadow: 0 2px 9px var(--shadow); white-space: nowrap; }
.chart-table { margin-top: 8px; font-size: .88rem; }
.chart-table summary { cursor: pointer; color: var(--link); font-weight: 700; }
.chart-table table { border-collapse: collapse; margin-top: 6px; }
.chart-table th, .chart-table td { border-bottom: 1px solid var(--soft-line); padding: 3px 12px 3px 0; text-align: right; font-variant-numeric: tabular-nums; }
.chart-table th:first-child, .chart-table td:first-child { text-align: left; }

/* ===== 用語解説 ===== */
dl.glossary dt { font-weight: 800; margin-top: 16px; padding-left: 12px; border-left: 5px solid var(--c3); }
dl.glossary dt:first-child { margin-top: 0; }
dl.glossary dd { margin: 4px 0 0; padding-left: 17px; }

/* ===== 前後のテーマ ===== */
.pager { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 6px 0 26px; }
.pager a { font-weight: 800; text-decoration: none; color: var(--text); background: color-mix(in srgb, var(--t) var(--tint), var(--tint-base)); border: 1.5px solid var(--line); border-radius: 999px; padding: 8px 18px; box-shadow: 0 2px 9px var(--shadow); }

/* ===== 共有 ===== */
.share-title { font-weight: 800; margin: 0 0 10px; }
.share { display: flex; flex-wrap: wrap; gap: 10px; }
.share a, .share button {
  font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer;
  padding: 7px 16px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--card); color: var(--text); text-decoration: none; box-shadow: 0 2px 9px var(--shadow);
}
.share .x { background: #000; color: #fff; }
.share .line { background: #00833e; color: #fff; }
.share .fb { background: #1463cc; color: #fff; }

/* ===== フッター ===== */
.foot { border-top: 1px solid var(--line); background: var(--card); padding: 22px 0 36px; color: var(--muted); font-size: .88rem; }
.foot a { color: var(--link); }

/* ===== スマホ調整 ===== */
.logo { white-space: nowrap; }
.home-themes { margin-top: 8px; }
@media (max-width: 700px) {
}
@media (max-width: 520px) {
  .logo b { display: none; }
  .logo::after { content: "まとめ"; font-weight: 800; margin-left: -4px; }
  .tgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .tcard { padding: 14px; border-radius: 16px; box-shadow: 0 3px 12px var(--shadow); }
  .tcard-title { font-size: 1rem; }
  .tcard-desc { font-size: .8rem; }
  .tcard-emoji { width: 40px; height: 40px; font-size: 1.3rem; }
  .card { padding: 16px; border-radius: 16px; box-shadow: 0 3px 12px var(--shadow); }
}
