:root {
  --bg: #f6f7f9; --card: #fff; --text: #1d2330; --muted: #667085; --line: #e4e7ec;
  --accent: #2f5bea; --accent-ink: #fff; --good: #12805c; --warn: #b54708; --bad: #c4320a;
  --track: #eaecf0; --field: #fff; --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1218; --card: #171b23; --text: #e6e8ec; --muted: #98a2b3; --line: #2a303b;
    --accent: #7b9bff; --accent-ink: #0f1218; --good: #3ccb8f; --warn: #f5a524; --bad: #f97066;
    --track: #2a303b; --field: #11151c;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
code { font: .85em ui-monospace, SFMono-Regular, Consolas, monospace; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
[hidden] { display: none !important; }

/* Header */
header.site { border-bottom: 1px solid var(--line); background: var(--card); }
.bar { display: flex; justify-content: space-between; align-items: center; height: 56px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); text-decoration: none; }
.logo { width: 24px; height: 24px; border-radius: 6px; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M9 16.5l4.5 4.5L23 11' stroke='white' stroke-width='3.2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat; }
nav a { font-size: .875rem; text-decoration: none; }

.intro { padding: 40px 0 8px; max-width: 720px; }
.intro h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); line-height: 1.2; letter-spacing: -.02em; margin: 0 0 12px; }
.intro p { color: var(--muted); margin: 0; font-size: 1rem; }

/* Panels */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; margin: 24px 0; }
.panel h2 { font-size: 1.15rem; margin: 0 0 16px; display: flex; align-items: center; gap: 10px; }
.num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font-size: .8rem; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.panel-head h2 { margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 12px; }
.hint { color: var(--muted); font-size: .875rem; }
.sub { font-size: 1rem; margin: 28px 0 12px; }

/* Drop zone */
.drop { display: grid; place-items: center; gap: 4px; text-align: center; padding: 36px 16px;
  border: 2px dashed var(--line); border-radius: var(--radius); cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over, .drop:focus-within { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop span { color: var(--muted); font-size: .875rem; }
.file-info { margin: 12px 0 0; font-weight: 600; }
.status { font-size: .8rem; color: var(--muted); }
.status.ok { color: var(--good); }
.status.error, .error { color: var(--bad); font-size: .875rem; }

/* Buttons & fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600;
  padding: 10px 18px; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent);
  color: var(--accent-ink); cursor: pointer; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--accent); }
.btn.small { padding: 6px 12px; font-size: .85rem; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type=text], input[type=number], select, textarea { font: inherit; font-size: .875rem; color: var(--text);
  background: var(--field); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
textarea { width: 100%; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .8rem; margin-top: 10px; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
thead th { color: var(--muted); font-weight: 600; font-size: .8rem; white-space: nowrap; background: var(--bg); }
tbody tr:last-child > * { border-bottom: 0; }
tbody th { font-weight: 600; white-space: nowrap; }
td.c { text-align: center; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
td.bad { color: var(--bad); font-weight: 600; }
.muted { color: var(--muted); }
.num-in { width: 84px; }
.regex { width: 150px; margin-left: 6px; }
.profile td.muted { max-width: 340px; }

.settings { display: flex; flex-wrap: wrap; gap: 16px 28px; margin-top: 20px; font-size: .875rem; }
.settings label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); }
.settings label.toggle { flex-direction: row; align-items: center; gap: 8px; color: var(--text); align-self: end; padding-bottom: 6px; }
.settings .inline { display: flex; align-items: center; gap: 6px; color: var(--text); }
.settings .inline input { width: 72px; }
.refs { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.advanced { margin-top: 20px; }
.advanced summary { cursor: pointer; font-size: .875rem; font-weight: 600; }
.run-row { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }

/* Results */
.summary { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; margin-top: 8px; }
.gauge { width: 150px; height: 150px; }
.gauge .track { fill: none; stroke: var(--track); stroke-width: 12; }
.gauge .arc { fill: none; stroke-width: 12; stroke-linecap: round; transition: stroke-dasharray .6s ease; }
.gauge.good .arc { stroke: var(--good); } .gauge.warn .arc { stroke: var(--warn); } .gauge.bad .arc { stroke: var(--bad); }
.gauge .pct { font-size: 26px; font-weight: 700; text-anchor: middle; fill: var(--text); }
.gauge .grade { font-size: 11px; text-anchor: middle; fill: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; }
.stat b { display: block; font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .8rem; }
.check { border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 10px; padding: 12px 16px; margin-bottom: 10px; }
.check.good { border-left-color: var(--good); } .check.warn { border-left-color: var(--warn); } .check.bad { border-left-color: var(--bad); }
.check header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.check h4 { margin: 0; font-size: .95rem; }
.check p { margin: 4px 0 0; color: var(--muted); font-size: .875rem; }
.check ul { margin: 8px 0 0; padding-left: 20px; font-size: .875rem; }
.check li { margin: 3px 0; overflow-wrap: anywhere; }
.pill { font-size: .72rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.pill.good { color: var(--good); } .pill.warn { color: var(--warn); } .pill.bad { color: var(--bad); } .pill.muted { color: var(--muted); }
.score { margin-left: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }

.site-foot { color: var(--muted); font-size: .8rem; padding-top: 8px; padding-bottom: 40px; }

@media (max-width: 640px) {
  .panel { padding: 18px 14px; }
  .summary { grid-template-columns: 1fr; justify-items: center; }
  .stats { width: 100%; grid-template-columns: repeat(3, 1fr); }
  .intro { padding-top: 28px; }
}
