:root{
  --bg:#fafafa;
  --card:#fff;
  --text:#111;
  --muted:#555;
  --border:#ddd;
  --shadow: 0 1px 0 rgba(0,0,0,.03);
  --radius: 14px;
}

*{ box-sizing:border-box; }
body{ margin:0; background:var(--bg); color:var(--text); font-family: system-ui, Arial, sans-serif; }
.wrap{ max-width:1100px; margin:0 auto; padding:18px; }

.site-header{
  position:sticky; top:0; z-index:10;
  background:rgba(250,250,250,.92);
  backdrop-filter: blur(8px);
  border-bottom:1px solid var(--border);
}
.site-header .wrap{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 18px; }

.brand{ display:flex; align-items:center; gap:12px; }
.logo{
  width:38px; height:38px; border-radius:12px;
  display:grid; place-items:center;
  border:1px solid var(--border);
  background:var(--card);
  font-weight:800;
}
.brand-title{ font-weight:800; }
.brand-sub{ color:var(--muted); font-size:13px; }

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:16px;
  box-shadow: var(--shadow);
}

.hero h1{ margin:0 0 8px; font-size:22px; }
.hero p{ margin:8px 0; line-height:1.4; }
.muted{ color:var(--muted); }
.small{ font-size:12px; }

.grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:16px;
  margin-top:16px;
}
.full{ grid-column: 1 / -1; }

.row{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-bottom:10px; }
.pill{
  border:1px solid var(--border);
  border-radius:999px;
  padding:6px 10px;
  font-size:13px;
  color:#444;
  background:#fff;
}
.pill-soft{ background:#f6f6f6; }

.question{ font-size:18px; margin:12px 0 16px; }

.btns{ display:flex; gap:12px; flex-wrap:wrap; }
.btn{
  padding:10px 16px;
  border-radius:12px;
  border:1px solid #999;
  cursor:pointer;
  background:#fff;
}
.btn:hover{ opacity:.92; }
.btn:disabled{ opacity:.6; cursor:not-allowed; }
.btn-ghost{ border-color: var(--border); color:#333; }
.btn-yes{ border-color:#3a3; }
.btn-no{ border-color:#a33; }

.meta{ margin-top:12px; display:flex; justify-content:space-between; flex-wrap:wrap; gap:12px; align-items:center; }

.chart-row{
  display:flex;
  gap:18px;
  align-items:flex-start;
}
.chart-wrap{
  flex:1;
  height:560px;
  min-width:0;
}

.legend{
  width:300px;
  display:grid;
  gap:10px;
  align-content:start;
}
.legend-item{
  display:grid;
  grid-template-columns: 64px 18px 1fr;
  align-items:center;
  gap:10px;
  font-size:14px;
}
.legend-pct{ text-align:right; font-variant-numeric: tabular-nums; }
.legend-swatch{ width:14px; height:14px; border-radius:4px; border:1px solid rgba(0,0,0,.2); }
.legend-label{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.answer-log{
  margin-top:12px;
  display:grid;
  gap:10px;
  min-height:120px;
  max-height:420px;
  overflow-y:auto;
  padding-right:6px;
}
.answer-item{
  border-radius:12px;
  padding:10px 12px;
  border:1px solid rgba(0,0,0,.12);
}
.answer-head{ font-weight:700; margin-bottom:4px; }
.answer-sub{ font-size:13px; opacity:.92; }

.sep{ border:none; border-top:1px solid var(--border); margin:18px 0; }

.comment-form{ display:grid; gap:10px; }
.input, .textarea{
  width:100%;
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 12px;
  font: inherit;
}
.comment-actions{ display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }

.comment-list{ margin-top:12px; display:grid; gap:10px; }
.comment{
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 12px;
  background:#fff;
}
.comment-top{ display:flex; justify-content:space-between; gap:12px; }
.comment-name{ font-weight:800; }
.comment-time{ color:var(--muted); font-size:12px; }
.comment-text{ margin-top:6px; line-height:1.35; }

.footer{ margin:20px 0 6px; text-align:center; }

@media (max-width: 980px){
  .grid{ grid-template-columns: 1fr; }
  .chart-row{ flex-direction: column; }
  .legend{ width:100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .legend-item{ grid-template-columns: 64px 18px 1fr; }
}
