:root {
  --bg: #f6f6f4; --surface: #fff; --text: #1d1d1b; --muted: #5f6368; --line: #dcdcd8;
  --accent: #1f3a5f; --accent-soft: #e8eef5;
  --high: #1f5f3a; --high-bg: #e5f2ea; --mid: #1f3a5f; --mid-bg: #e8eef5; --low: #6b4a12; --low-bg: #f6eedd;
  --out: #5f6368; --out-bg: #ececea; --warn-bg: #fff6d9;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161716; --surface: #1f2120; --text: #e9e9e6; --muted: #a3a6a9; --line: #3a3d3b;
    --accent: #9cc0ea; --accent-soft: #23303f;
    --high: #8fd4a8; --high-bg: #1d3326; --mid: #9cc0ea; --mid-bg: #23303f; --low: #e6c27f; --low-bg: #3a2f1a;
    --out: #a3a6a9; --out-bg: #2b2d2c; --warn-bg: #3a331a;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", sans-serif;
  font-size: 16px; line-height: 1.7; }
a { color: var(--accent); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); font-size: .88em; }
h1 { font-size: 1.4rem; margin: .6em 0 .4em; line-height: 1.4; }
h2 { font-size: 1.08rem; margin: 1em 0 .5em; }
h3 { font-size: .95rem; margin: 1em 0 .3em; }

header.site { background: var(--surface); border-bottom: 1px solid var(--line); }
header.site .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; padding-top: 10px; padding-bottom: 10px; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; }
header nav a { margin-left: 14px; text-decoration: none; font-size: .95rem; }
header nav a:first-child { margin-left: 0; }
.notice { background: var(--warn-bg); border-bottom: 1px solid var(--line); font-size: .9rem; }
.notice .wrap { padding-top: 6px; padding-bottom: 6px; }
footer.site { margin-top: 48px; border-top: 1px solid var(--line); padding: 16px 0 32px; font-size: .85rem; color: var(--muted); }

.cols { display: grid; gap: 16px; }
@media (min-width: 900px) {
  .cols { grid-template-columns: 340px 1fr; align-items: start; gap: 28px; }
}

.filters { display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 12px 0; }
.filters label { display: flex; flex-direction: column; font-size: .85rem; color: var(--muted); }
.filters select, input, textarea, select { font: inherit; font-size: 1rem; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); }
.filters select { min-width: 10em; }
.howto summary { cursor: pointer; padding: 8px 0; font-weight: 600; }
.howto { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 4px 14px; font-size: .88rem; }

.member-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.member-card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; color: inherit; text-decoration: none; }
.member-card:hover { border-color: var(--accent); }
.mc-name { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.mc-name .name { font-weight: 700; font-size: 1.08rem; }
.mc-metrics { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 8px; margin-top: 6px; }
.metric { display: flex; flex-direction: column; }
.metric .label { font-size: .78rem; color: var(--muted); }
.metric .value { font-size: 1.05rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.metric.big .value { font-size: 1.5rem; }
.metric .note { font-size: .78rem; color: var(--muted); }

.member-head h1 { margin-bottom: 0; }
.member-head p { margin-top: 2px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 8px 0 14px; }
.tabs a { padding: 8px 12px; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.tabs a.none { opacity: .55; }

.eval-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 14px 12px; margin-bottom: 12px; }
.eval-card h2 { margin-top: .6em; }
.eval-card .total { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.eval-card .total .label { font-size: .85rem; color: var(--muted); }
.eval-card .total .value { font-size: 2.2rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.eval-card .total .note { color: var(--muted); font-size: .85rem; }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin: 10px 0; }
.ratio { font-size: .88rem; margin: 8px 0; }
.eval-card.pending { opacity: .85; }
.accounts ul { padding-left: 1.2em; margin: 0; }

svg.trend { width: 100%; height: auto; display: block; }
svg.trend .grid { stroke: var(--line); stroke-width: 1; }
svg.trend .axis { fill: var(--muted); font-size: 10px; }
svg.trend .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
svg.trend .dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
svg.trend .hit { fill: transparent; }
svg.trend .pt:hover .dot { r: 6; }
.table-view { font-size: .85rem; margin-top: 6px; }
.table-view table, table.list { border-collapse: collapse; width: 100%; }
.table-view td, .table-view th, table.list td, table.list th { border-bottom: 1px solid var(--line); padding: 4px 6px; text-align: left; }
.table-scroll { overflow-x: auto; }
.rubric table { border-collapse: collapse; width: 100%; font-size: .92rem; background: var(--surface); }
.rubric th, .rubric td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.rubric td:last-child { white-space: nowrap; }
.history { padding-left: 1.2em; }
.history a.on { font-weight: 700; }

.count { margin: 4px 0 10px; }
.post-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; }
.pc-head { display: flex; gap: 12px; align-items: center; }
.score { display: inline-flex; align-items: baseline; justify-content: center; min-width: 3.6em; padding: 4px 8px; border-radius: 6px; font-weight: 700; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.score small { font-size: .7em; margin-left: 1px; }
.score.high { color: var(--high); background: var(--high-bg); }
.score.mid { color: var(--mid); background: var(--mid-bg); }
.score.low { color: var(--low); background: var(--low-bg); }
.score.out { color: var(--out); background: var(--out-bg); font-size: .95rem; font-weight: 600; }
.pc-meta { display: flex; flex-direction: column; line-height: 1.4; }
.pc-meta .cat { font-weight: 600; }
.reason { margin: 8px 0 4px; }
.provisional { display: inline-block; margin: 2px 0; padding: 0 8px; font-size: .82rem; border: 1px solid var(--line); border-radius: 4px; background: var(--warn-bg); }
.excerpt { margin: 6px 0; padding: 6px 10px; border-left: 3px solid var(--line); color: var(--muted); font-size: .9rem; white-space: pre-wrap; word-break: break-word; }
.excerpt summary { cursor: pointer; }
.excerpt details[open] summary { display: none; }
.pc-foot { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .85rem; }

/* 管理画面 */
body.admin header.site { background: var(--accent-soft); }
.flash { background: var(--warn-bg); padding: 6px 10px; border-radius: 6px; }
.review-row { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.rr-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.rr-edit { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: end; }
.rr-edit label, .form-grid label { display: flex; flex-direction: column; font-size: .85rem; color: var(--muted); }
.rr-edit label:has(input[type=checkbox]), .form-grid label:has(input[type=checkbox]) { flex-direction: row; align-items: center; gap: 6px; }
.rr-edit .wide, .form-grid .wide { flex-basis: 100%; }
.rr-edit input[type=number] { width: 5em; }
.rr-edit .now { font-weight: 600; padding-bottom: 6px; }
.rr-actions, .row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.row-actions { margin: 0; }
.form-grid { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; margin: 8px 0 16px; }
textarea { width: 100%; }
button { font: inherit; padding: 6px 14px; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: var(--surface); cursor: pointer; }
button.sub { background: var(--surface); color: var(--accent); }
button.danger { background: var(--surface); color: #a3271f; border-color: #a3271f; }
.bulk { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
td.break { word-break: break-all; }
