:root {
  --bg: #f6f5f1; --surface: #fcfcfb; --line: #e1e0d9; --ink: #1d1c1a; --ink2: #56544f; --muted: #6f6d68;
  --accent: #2a78d6; --accent-soft: #e6f0fb; --good: #1f7a3f; --good-soft: #e4f3e8; --warn: #9a5b00; --warn-soft: #fbf0db;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 'Malgun Gothic', 'Apple SD Gothic Neo', system-ui, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
header.top { background: var(--surface); border-bottom: 1px solid var(--line); padding: 12px 20px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
header.top .brand { font-weight: 700; font-size: 17px; color: var(--ink); }
header.top .topnav { margin-left: auto; display: flex; gap: 16px; font-size: 14px; align-items: center; }
input[type=password] { font: inherit; padding: 7px 10px; border: 1px solid #c3c2b7; border-radius: 8px; background: #fff; color: var(--ink); }
.card.narrow { max-width: 380px; margin: 40px auto; }
.card.narrow input { width: 100%; }
.keybox { font-family: Consolas, monospace; font-size: 13px; background: #f1f0eb; border-radius: 8px; padding: 10px 12px; margin-top: 10px; word-break: break-all; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: var(--warn-soft); color: var(--warn); white-space: nowrap; }
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.plain { background: #ecebe6; color: var(--ink2); }
main { max-width: 1040px; margin: 0 auto; padding: 20px 16px 60px; }
h1 { font-size: 22px; margin: 4px 0 4px; }
h2 { font-size: 16px; margin: 0 0 12px; }
.sub { color: var(--ink2); margin: 0 0 16px; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.tile .k { font-size: 12px; color: var(--muted); }
.tile .v { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile .n { font-size: 12px; color: var(--ink2); }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12px; color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; }
tr.click { cursor: pointer; }
tr.click:hover { background: #f1f0eb; }
tr.best td { font-weight: 700; }
.slow { color: #a33a2a; } .fast { color: var(--good); }
form.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
input[type=text], input[type=date], input[type=number], select, textarea {
  font: inherit; padding: 7px 10px; border: 1px solid var(--axis, #c3c2b7); border-radius: 8px; background: #fff; color: var(--ink);
}
textarea { width: 100%; min-height: 64px; resize: vertical; }
button { font: inherit; padding: 8px 14px; border-radius: 8px; border: 1px solid #c3c2b7; background: #fff; color: var(--ink); cursor: pointer; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button:disabled { opacity: .5; cursor: default; }
.field { margin-bottom: 14px; }
.choices { display: flex; gap: 6px; flex-wrap: wrap; }
.choices button { padding: 6px 12px; }
.choices button[aria-pressed=true] { background: var(--accent-soft); border-color: var(--accent); color: #174a8a; font-weight: 600; }
.itemrow { display: grid; grid-template-columns: 130px 1fr; gap: 10px; align-items: center; margin-bottom: 8px; }
.note { font-size: 13px; color: var(--ink2); background: #f1f0eb; border-radius: 8px; padding: 10px 12px; }
.error { color: #a33a2a; font-size: 13px; margin-top: 8px; }
.ok { color: var(--good); font-size: 13px; margin-top: 8px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink2); margin-bottom: 4px; }
.legend i, .chart-tip i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; }
.chart-wrap { position: relative; }
.chart-wrap svg, .card svg { width: 100%; height: auto; display: block; }
.chart-tip { position: absolute; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 12px; pointer-events: none; box-shadow: 0 2px 8px rgba(0,0,0,.08); min-width: 130px; }
.stepper { display: inline-flex; align-items: center; gap: 6px; }
.stepper button { width: 30px; height: 30px; padding: 0; border-radius: 50%; font-size: 17px; line-height: 1; }
.stepper b { min-width: 18px; text-align: center; }
.evalitem { border-top: 1px solid var(--line); padding: 10px 0; font-size: 14px; }
.evalitem:first-child { border-top: 0; }
.kv { color: var(--ink2); }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } .itemrow { grid-template-columns: 1fr; } }
