:root {
  --bg: #0d1117;
  --bar-bg: #161b22;
  --bar-border: #30363d;
  --fg: #e6edf3;
  --muted: #8b949e;
  --accent: #f59e0b;
  --error: #f85149;
  --radius: 14px;
  --pill: 999px;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(3rem, 9vh, 5rem) 1.25rem 5rem;
}

/* ---- identity ---------------------------------------------------------- */
.brand {
  margin: 0 0 6px;
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  user-select: none;
}
.brand-dot { color: var(--accent); }
.brand-dot.dim { opacity: 0.4; }

.lede { margin: 0; font-size: 1rem; color: var(--muted); }

.label {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
}
.label.spaced { margin-top: 1.5rem; }

/* ---- panels ------------------------------------------------------------- */
.panel {
  background: var(--bar-bg);
  border: 1px solid var(--bar-border);
  border-radius: var(--radius);
  padding: 1.35rem;
  margin-top: 1.25rem;
}

.hint { color: var(--muted); font-size: 0.9rem; margin: 0.4rem 0 1rem; }
.hint b { color: var(--fg); font-weight: 500; }

/* ---- file chips --------------------------------------------------------- */
.chips { display: grid; gap: 0.6rem; }

.drop-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--bar-border);
  border-radius: var(--pill);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.drop-chip:hover { border-color: var(--muted); }
.drop-chip:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}
.drop-chip input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.chip-kind {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.chip-state { margin-left: auto; font-size: 0.9rem; color: var(--muted); }
.chip-state.set { color: var(--fg); }

/* ---- buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  font-size: 0.92rem;
  font-weight: 600;
  font-family: inherit;
  color: #0d1117;
  background: var(--accent);
  border: 1px solid transparent;
  border-radius: var(--pill);
  cursor: pointer;
  text-decoration: none;
  user-select: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, filter 0.15s ease;
}
.btn:hover { filter: brightness(1.07); }
.btn:disabled {
  background: transparent;
  color: var(--muted);
  border-color: var(--bar-border);
  cursor: not-allowed;
  filter: none;
}
.btn.ghost {
  color: var(--fg);
  background: transparent;
  border-color: var(--bar-border);
  font-weight: 500;
  padding: 7px 14px;
  font-size: 0.85rem;
}
.btn.ghost:hover {
  border-color: var(--muted);
  background: color-mix(in srgb, var(--fg) 6%, transparent);
}

.panel-actions { margin-top: 1.1rem; }

.hidden { display: none; }

.error {
  margin-top: 0.9rem;
  padding: 10px 14px;
  font-size: 0.9rem;
  color: #ffa198;
  background: color-mix(in srgb, var(--error) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--error) 40%, transparent);
  border-radius: 10px;
}

/* ---- results ------------------------------------------------------------ */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(125px, 1fr));
  gap: 0.6rem;
  margin-top: 1rem;
}
.stat-card {
  background: var(--bg);
  border: 1px solid var(--bar-border);
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
}
.stat-value {
  font-size: 1.5rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.stat-card.key .stat-value { color: var(--accent); }
.stat-label {
  margin-top: 2px;
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.report-list { margin-top: 0.4rem; border-top: 1px solid var(--bar-border); }
.report-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 0.85rem 0.25rem;
  border-bottom: 1px solid var(--bar-border);
  flex-wrap: wrap;
}
.report-row:last-child { border-bottom: none; }
.report-name { display: flex; align-items: center; gap: 8px; font-weight: 500; flex-wrap: wrap; }
.report-desc { margin-top: 2px; font-size: 0.85rem; color: var(--muted); }
.report-actions { display: flex; gap: 8px; }

.count {
  padding: 1px 9px;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  background: color-mix(in srgb, var(--fg) 6%, transparent);
  border: 1px solid var(--bar-border);
  border-radius: var(--pill);
}

/* ---- about dialog ------------------------------------------------------------ */
.about-link {
  position: fixed;
  bottom: 14px;
  right: 18px;
  padding: 4px 8px;
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  font-family: inherit;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease;
}
.about-link:hover { color: var(--fg); }

dialog {
  width: min(540px, 92vw);
  margin: auto;
  padding: 0;
  color: var(--fg);
  background: var(--bar-bg);
  border: 1px solid var(--bar-border);
  border-radius: var(--radius);
}
dialog::backdrop { background: rgb(0 0 0 / 0.55); }
.dialog-inner {
  padding: 26px 30px 30px;
  max-height: min(74dvh, 640px);
  overflow-y: auto;
  font-size: 0.95rem;
  line-height: 1.6;
}
.dialog-inner h2 {
  margin: 0 0 6px;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  user-select: none;
}
.dialog-lede { margin: 0 0 14px; font-size: 1.05rem; }
.dialog-inner p { margin: 0; }
.dialog-inner ul { margin: 0; padding-left: 18px; display: grid; gap: 10px; }
.dialog-inner h3 {
  margin: 22px 0 8px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
}
.dialog-inner strong { font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
