:root {
  --bg: #f6f7f5;
  --surface: #ffffff;
  --text: #1b1f1e;
  --muted: #5f6b68;
  --line: #e2e6e4;
  --brand: #2d683d;
  --brand-light: #40904b;
  --on-accent: #ffffff;
  --accent: #2d683d;
  --chip: #ebf3ed;
  --high: #b42318;
  --high-bg: #fdecea;
  --mid: #9a6700;
  --mid-bg: #fff4d6;
  --low: #3d5a80;
  --low-bg: #e8eef7;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1312;
    --surface: #171d1c;
    --text: #e8eceb;
    --muted: #9aa6a3;
    --line: #2a3331;
    --brand: #1f4a2b;
    --brand-light: #2d683d;
    --on-accent: #0e1a10;
    --accent: #7cc48a;
    --chip: #1d2a20;
    --high: #ff8a80;
    --high-bg: #3a1714;
    --mid: #f2c14e;
    --mid-bg: #352a10;
    --low: #9ab8e6;
    --low-bg: #1a2433;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.7 -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: var(--brand); color: #fff;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: .01em; white-space: nowrap; flex: none; }
.logo { display: block; width: 30px; height: 30px; border-radius: 8px; box-shadow: 0 0 0 1px rgba(255,255,255,.35); }
.date-pick select {
  appearance: none; -webkit-appearance: none;
  background: rgba(255,255,255,.12); color: #fff;
  border: 1px solid rgba(255,255,255,.25); border-radius: 10px;
  padding: 6px 12px; font: inherit; font-size: 14px;
}
.date-pick option { color: #000; }

main { max-width: 760px; margin: 0 auto; padding: 16px; }
.state { color: var(--muted); text-align: center; padding: 48px 0; }
.notice {
  margin: 0 0 12px; padding: 8px 12px; border-radius: 10px; font-size: 13px;
  background: var(--mid-bg); color: var(--mid);
}

.meta { margin: 4px 0 2px; color: var(--muted); font-size: 13px; }
h1 { font-size: 22px; line-height: 1.45; margin: 0 0 12px; }
.tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 0 0 14px;
  background: var(--chip); border: 1px solid var(--line); border-radius: 12px;
}
.tab {
  border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 700;
  padding: 8px 0; border-radius: 9px; cursor: pointer;
}
.tab[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

.exec {
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 22px;
}
.exec-title { margin: 0 0 6px; font-size: 13px; letter-spacing: .06em; color: var(--accent); }
.exec-body { margin: 0; white-space: pre-wrap; }
.points { margin: 12px 0 0; padding: 12px 0 0 1.2em; border-top: 1px dashed var(--line); }
.points li { margin: 0 0 6px; font-weight: 600; }
.points li::marker { color: var(--accent); }

.section-title { font-size: 17px; margin: 24px 0 10px; }
.list-head .section-title { margin-top: 0; }
.section-note { margin: -6px 0 10px; color: var(--muted); font-size: 13px; }

.filters { display: grid; gap: 8px; margin-bottom: 14px; }
.filter-row { display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-label { flex: none; width: 2.3em; font-size: 12px; font-weight: 700; color: var(--muted); }
.chip {
  flex: none; border: 1px solid var(--line); background: var(--chip); color: var(--text);
  border-radius: 999px; padding: 5px 10px; font: inherit; font-size: 13px; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip-n { margin-left: 5px; font-size: 11px; opacity: .7; }
.empty { color: var(--muted); text-align: center; padding: 24px 0; margin: 0; }

.items { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
}
.card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 12px; color: var(--muted); }
.badge { font-weight: 700; border-radius: 6px; padding: 1px 8px; font-size: 12px; }
.badge.高 { color: var(--high); background: var(--high-bg); }
.badge.中 { color: var(--mid); background: var(--mid-bg); }
.badge.低 { color: var(--low); background: var(--low-bg); }
.card h3 { font-size: 17px; line-height: 1.5; margin: 6px 0 6px; }
.card p { margin: 0 0 8px; }
.facts { background: var(--chip); border-radius: 10px; padding: 8px 12px; margin: 0 0 10px; }
.facts strong { display: block; font-size: 12px; color: var(--muted); }
.facts ul { margin: 2px 0 0; padding-left: 1.2em; font-size: 15px; }
.facts li { margin: 2px 0; }
.card details { border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 4px; }
.card summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 14px; }
.card dl { margin: 8px 0 0; font-size: 15px; }
.card dt { font-weight: 700; font-size: 13px; color: var(--muted); margin-top: 8px; }
.card dd { margin: 2px 0 0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag {
  font: inherit; font-size: 12px; color: var(--accent); background: var(--chip); border: 1px solid var(--line);
  border-radius: 6px; padding: 2px 8px; cursor: pointer;
}
.tag:hover { border-color: var(--accent); }
.tag-n { margin-left: 4px; font-size: 11px; color: var(--muted); }
.card.focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); transition: box-shadow .3s; }
.back-btn { margin-bottom: 10px; }
.tag-title { margin-bottom: 2px; color: var(--accent); }
.bn-title { display: block; font-size: 15px; font-weight: 600; margin-top: 4px; }
.bn-tags { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.src { display: inline-block; margin-top: 10px; font-size: 14px; color: var(--accent); text-decoration: none; word-break: break-all; }
.src:hover { text-decoration: underline; }
.pill { border: 1px solid var(--line); border-radius: 6px; padding: 0 7px; color: var(--text); }

.rank-card { display: grid; grid-template-columns: 34px 1fr; gap: 12px; }
.rank {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-weight: 800; font-size: 16px;
}
.rank-body { min-width: 0; }
.action { display: grid; gap: 2px; background: var(--chip); border-radius: 10px; padding: 8px 12px; font-size: 15px; }
.action strong { font-size: 12px; color: var(--muted); }
.link-btn {
  display: block; margin-top: 8px; padding: 0; border: 0; background: none; font: inherit; font-size: 14px;
  color: var(--accent); cursor: pointer;
}
.trends { display: grid; gap: 10px; }
.trend { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.trend h3 { font-size: 15px; margin: 0 0 4px; }
.trend p { margin: 0; }
.next { margin: 0; padding-left: 1.2em; }
.next li { margin-bottom: 6px; }

.issue-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 12px; }
.issue-nav .label { font-weight: 700; font-size: 15px; text-align: center; flex: 1; }
.issue-nav .latest { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 700; color: var(--on-accent); background: var(--accent); border-radius: 999px; padding: 1px 8px; vertical-align: 2px; }
.nav-btn {
  flex: none; min-width: 92px; border: 1px solid var(--line); background: var(--surface); color: var(--accent);
  border-radius: 10px; padding: 7px 10px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.nav-btn:disabled { color: var(--muted); opacity: .45; cursor: default; }

.backnumbers { margin-top: 28px; }
.backnumbers h2 { font-size: 16px; margin: 0 0 10px; }
.bn-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bn-item {
  display: block; width: 100%; text-align: left; font: inherit; color: var(--text); cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px;
}
.bn-item:hover { border-color: var(--accent); }
.bn-date { font-weight: 700; font-size: 14px; }
.bn-count { color: var(--muted); font-size: 12px; margin-left: 6px; }
.bn-head { display: block; font-size: 14px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.logout { display: inline-block; margin-top: 8px; color: var(--muted); }
.foot { max-width: 760px; margin: 8px auto 0; padding: 16px 16px calc(env(safe-area-inset-bottom) + 24px); color: var(--muted); font-size: 12px; }
