:root {
  color-scheme: dark light;
  --bg: #0b0f19;
  --panel: #121828;
  --panel-2: #182036;
  --line: #26304a;
  --text: #e8ecf5;
  --muted: #9aa5bf;
  --accent: #7c5cff;
  --accent-2: #a58cff;
  --ok: #3ddc97;
  --warn: #ffb547;
  --bad: #ff6b6b;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f7fb;
    --panel: #ffffff;
    --panel-2: #f0f2f8;
    --line: #d9deea;
    --text: #141a2b;
    --muted: #5d6784;
    --accent: #5b3df5;
    --accent-2: #7c5cff;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--sans);
  min-height: 100vh;
}
code { font-family: var(--mono); font-size: 0.92em; background: var(--panel-2); padding: 0.05em 0.35em; border-radius: 4px; }
a { color: var(--accent-2); }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.1rem clamp(1rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 0.8rem; }
.logo { width: 40px; height: 40px; flex: none; }
.brand h1 { margin: 0; font-size: 1.25rem; letter-spacing: 0.01em; }
.tag { margin: 0; color: var(--muted); font-size: 0.86rem; }

.status {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.8rem; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line);
  font-size: 0.86rem; white-space: nowrap;
}
.status .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.status[data-state="loading"] .dot { background: var(--warn); animation: pulse 1.2s ease-in-out infinite; }
.status[data-state="ready"] .dot { background: var(--ok); }
.status[data-state="offline"] .dot { background: var(--accent-2); }
.status[data-state="error"] .dot { background: var(--bad); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

main { max-width: 1080px; margin: 0 auto; padding: 1.5rem clamp(1rem, 4vw, 2.5rem) 3rem; }
.hero h2 { margin: 0.5rem 0 0.4rem; font-size: clamp(1.5rem, 3.4vw, 2.1rem); line-height: 1.2; }
.hero p { margin: 0; color: var(--muted); max-width: 66ch; }

.drop {
  margin-top: 1.5rem;
  border: 2px dashed var(--line);
  border-radius: 16px;
  background: var(--panel);
  padding: 2.2rem 1.5rem;
  text-align: center;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
  cursor: pointer;
  outline: none;
}
.drop:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); }
.drop.over { border-color: var(--accent); background: var(--panel-2); transform: scale(1.005); }
.drop.disabled { opacity: 0.6; cursor: progress; }
.drop-icon { width: 48px; height: 48px; color: var(--accent-2); }
.drop-title { margin: 0.6rem 0 0.2rem; font-size: 1.1rem; font-weight: 600; }
.drop .muted { margin: 0.2rem 0; }
.actions { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; margin: 0.6rem 0 0.8rem; }

.btn {
  font: inherit; font-size: 0.95rem;
  padding: 0.55rem 1rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  cursor: pointer;
}
.btn:hover { border-color: var(--accent-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.small { font-size: 0.85rem; padding: 0.4rem 0.75rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.results { margin-top: 1.6rem; }
.results-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.summary { margin: 0; font-weight: 600; }
.summary .warn { color: var(--warn); }
.results-actions { display: flex; gap: 0.5rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
table { border-collapse: collapse; width: 100%; min-width: 760px; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; background: var(--panel-2); position: sticky; top: 0; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.pending td { color: var(--muted); }
tbody tr.mismatch td.ext { color: var(--warn); }
td.file .name { font-weight: 600; word-break: break-all; }
td.file .path { color: var(--muted); font-size: 0.8rem; word-break: break-all; }
td.file .size { color: var(--muted); font-size: 0.8rem; }
td.type .label { display: inline-block; font-family: var(--mono); font-size: 0.8rem; padding: 0.05rem 0.4rem; border-radius: 5px; background: var(--panel-2); margin-left: 0.3rem; }
td.type .also { display: block; color: var(--muted); font-size: 0.78rem; margin-top: 0.15rem; }
td.type .note { display: block; color: var(--warn); font-size: 0.78rem; margin-top: 0.15rem; }
td.mime { font-family: var(--mono); font-size: 0.82rem; color: var(--muted); }
td.conf { min-width: 120px; }
.meter { position: relative; height: 6px; border-radius: 3px; background: var(--panel-2); margin-top: 0.35rem; overflow: hidden; }
.meter > span { position: absolute; inset: 0 auto 0 0; background: var(--ok); border-radius: 3px; }
tr.low .meter > span { background: var(--warn); }
td.ext .ok { color: var(--ok); }
td.ext .dash { color: var(--muted); }

.about { margin-top: 2.4rem; }
.about h3 { margin: 0 0 0.5rem; font-size: 1.1rem; }
.about ul { margin: 0; padding-left: 1.2rem; color: var(--muted); }
.about li { margin: 0.35rem 0; }
.about strong { color: var(--text); }

.foot {
  border-top: 1px solid var(--line);
  padding: 1rem clamp(1rem, 4vw, 2.5rem) 2rem;
  display: flex; gap: 1rem; flex-wrap: wrap;
  color: var(--muted); font-size: 0.84rem;
}
.toast {
  position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%);
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  padding: 0.6rem 1rem; border-radius: 10px; font-size: 0.9rem; box-shadow: 0 8px 30px rgba(0,0,0,0.35);
  opacity: 0; transition: opacity 0.2s; pointer-events: none;
}
.toast.show { opacity: 1; }

@media (max-width: 640px) {
  .top { flex-direction: column; align-items: flex-start; }
  .drop { padding: 1.6rem 1rem; }
}
