:root {
  --ink: #1e1b2e; --muted: #6b7280; --line: #e5e7eb; --bg: #f5f3fb;
  --card: #fff; --accent: #7c3aed; --accent-d: #6d28d9;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.5; padding-bottom: 44px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 15px 24px;
  background: linear-gradient(135deg, #5b21b6, #7c3aed); color: #fff; }
.brand { font-size: 20px; } .brand .tag { font-size: 12px; opacity: .85; font-weight: 400; margin-left: 6px; }
.repo { color: #ddd6fe; text-decoration: none; font-weight: 600; font-size: 14px; } .repo:hover { color: #fff; }
.intro { max-width: 1080px; margin: 18px auto 0; padding: 0 20px; color: #4b5563; font-size: 15px; }

.layout { max-width: 1080px; margin: 16px auto 0; padding: 0 20px; display: grid;
  grid-template-columns: 280px 1fr 1fr; gap: 16px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px;
  box-shadow: 0 1px 3px rgba(30,27,46,.05); }
.panel h2 { font-size: 16px; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.panel h3 { font-size: 13px; margin: 14px 0 6px; font-weight: 600; }
.muted { color: var(--muted); font-weight: 400; font-size: 12px; }

.f { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; font-size: 13px; }
.f > span { color: var(--muted); font-weight: 600; }
.f em { color: var(--accent); font-style: normal; float: right; }
select { border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; font-size: 14px; background: #fff; }
input[type=range] { accent-color: var(--accent); }
.f.check { flex-direction: row; align-items: center; gap: 8px; }
.f.check span { color: var(--ink); font-weight: 500; }

.btns { display: flex; gap: 8px; margin: 6px 0 12px; }
.btn { border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 9px 14px;
  border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn:hover { background: #f5f3ff; } .btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-d); } .btn.small { padding: 5px 10px; font-size: 12px; }
.live { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted);
  border-top: 1px solid var(--line); padding-top: 12px; } .live b { color: var(--ink); }

canvas { width: 100%; height: auto; background: #fff; border-radius: 8px; display: block; }
#value, #policy, #visit { image-rendering: pixelated; border: 1px solid var(--line); }

.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.metric { border: 1px solid var(--line); border-radius: 10px; padding: 10px; text-align: center; }
.m-v { font-size: 22px; font-weight: 800; } .m-k { font-size: 11px; color: var(--muted); text-transform: uppercase; }
.hint { color: var(--muted); font-size: 13px; }

.grids { max-width: 1080px; margin: 16px auto 0; }
.grid-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
figure { text-align: center; } figcaption { font-size: 13px; font-weight: 600; margin-top: 8px; }
.key { display: block; font-weight: 400; font-size: 11px; color: var(--muted); margin-top: 3px; }
.key i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 2px 0 6px; vertical-align: middle; }
.foot { text-align: center; color: var(--muted); font-size: 13px; margin-top: 28px; }

@media (max-width: 920px) { .layout { grid-template-columns: 1fr; } .grid-row { grid-template-columns: 1fr; } }
