* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Hiragino Sans", "Yu Gothic UI", sans-serif; background: #f4f5f7; color: #1d1f23; font-size: 15px; }
[hidden] { display: none !important; }
button { font: inherit; padding: 8px 16px; border: 0; border-radius: 6px; background: #2b5cd6; color: #fff; cursor: pointer; }
button:disabled { opacity: .5; cursor: wait; }
button.ghost { background: transparent; color: #2b5cd6; border: 1px solid #2b5cd6; padding: 4px 10px; }
button.mini { padding: 3px 8px; font-size: 12px; }
input, select, textarea { font: inherit; width: 100%; padding: 7px 8px; border: 1px solid #c8ccd3; border-radius: 6px; background: #fff; }
textarea { resize: vertical; }
label { display: block; margin: 6px 0; font-size: 13px; color: #444; }
label > input, label > select, label > textarea { margin-top: 3px; }
.msg { color: #c0392b; font-size: 13px; margin-left: 8px; }
.msg.ok { color: #1e7e34; }
.muted { color: #777; }
.small { font-size: 13px; }

.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-box { width: min(320px, 90vw); display: grid; gap: 10px; }

.top { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: #fff; border-bottom: 1px solid #e1e4e8; }
.top h1 { font-size: 18px; margin: 0; flex: 1; }

.bars { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; padding: 10px 16px; }
.bar { background: #fff; border: 1px solid #e1e4e8; border-radius: 8px; padding: 8px 10px; }
.bar .name { font-weight: 600; font-size: 14px; }
.bar .track { height: 10px; background: #e9ecef; border-radius: 5px; overflow: hidden; margin: 6px 0; }
.bar .fill { height: 100%; background: #2e9e5b; }
.bar.low { border-color: #d93025; background: #fff5f5; }
.bar.low .fill { background: #d93025; }
.bar.low .remain { color: #d93025; font-weight: 700; }
.bar .line { font-size: 12px; color: #555; }

.grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; padding: 0 16px 24px; }
@media (max-width: 860px) { .grid { grid-template-columns: 1fr; } }
.card { background: #fff; border: 1px solid #e1e4e8; border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; }
.card h2 { font-size: 15px; margin: 0 0 8px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }

.result { margin-top: 12px; border-top: 1px solid #e1e4e8; padding-top: 10px; }
.result pre { white-space: pre-wrap; word-break: break-word; background: #f7f8fa; padding: 10px; border-radius: 6px; max-height: 60vh; overflow: auto; }
.result .meta { font-size: 12px; color: #555; }
.rec { display: inline-block; padding: 2px 8px; border-radius: 10px; background: #eef3ff; font-weight: 600; margin-right: 6px; }
.err { color: #c0392b; }

.cand { border: 1px solid #e1e4e8; border-radius: 6px; padding: 6px 8px; margin: 6px 0; }
.cand.off { opacity: .55; }
.history { max-height: 50vh; overflow: auto; }
.history table { width: 100%; border-collapse: collapse; }
.history td, .history th { border-bottom: 1px solid #eee; padding: 3px 4px; text-align: left; vertical-align: top; }
.history .head { color: #666; }
