:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --ink: #1d2320;
  --muted: #5f6763;
  --line: #e2e0d9;
  --accent: #146c5a;
  --accent-soft: #e3f1ec;
  --danger: #b3261e;
  --danger-soft: #fbe9e7;
  --radius: 12px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141816;
    --surface: #1c211f;
    --ink: #e8ebe9;
    --muted: #9aa39f;
    --line: #2d3431;
    --accent: #4cc3a3;
    --accent-soft: #173029;
    --danger: #f2877d;
    --danger-soft: #3a1f1c;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.wrap { max-width: 760px; margin: 0 auto; padding: 48px 16px 64px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.head h1 { font-size: clamp(1.8rem, 5vw, 2.4rem); letter-spacing: -0.02em; margin: 0 0 8px; }
.lead { margin: 0 0 14px; color: var(--muted); font-size: 1.05rem; max-width: 60ch; }
.privacy {
  display: inline-flex; align-items: center; gap: 8px; margin: 0;
  padding: 6px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: .9rem; font-weight: 500;
}
.privacy svg { width: 16px; height: 16px; fill: currentColor; flex: none; }

.drop {
  margin-top: 28px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 44px 20px; text-align: center; cursor: pointer;
  background: var(--surface); border: 2px dashed var(--line); border-radius: var(--radius);
  transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over, .drop:focus-within { border-color: var(--accent); background: var(--accent-soft); }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.drop svg { width: 36px; height: 36px; stroke: var(--accent); stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 6px; }
.drop strong { font-size: 1.1rem; }
.drop span { color: var(--muted); }
.drop small { margin-top: 10px; color: var(--muted); font-size: .8rem; letter-spacing: .02em; }

.opts { border: 0; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; }
.opts label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: .95rem; cursor: pointer; }
.opts input { accent-color: var(--accent); transform: translateY(1px); }
.hint { color: var(--muted); font-size: .85rem; flex-basis: 100%; padding-left: 22px; }

.results { margin-top: 32px; }
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.bar h2 { font-size: 1.1rem; margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 16px; border-radius: 8px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--surface); font: inherit; font-size: .9rem; font-weight: 600;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.small { padding: 6px 12px; font-size: .85rem; }

.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.badge {
  flex: none; min-width: 52px; padding: 4px 6px; border-radius: 6px; text-align: center;
  font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: var(--accent-soft); color: var(--accent);
}
.meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status { font-size: .85rem; color: var(--muted); }
.item.error .badge { background: var(--danger-soft); color: var(--danger); }
.item.error .status { color: var(--danger); }
.item.busy .status::after { content: ""; display: inline-block; width: 10px; height: 10px; margin-left: 8px; border: 2px solid var(--muted); border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }

.found { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.found summary { cursor: pointer; font-size: .88rem; color: var(--accent); font-weight: 500; }
.found table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: .85rem; table-layout: fixed; }
.found td { padding: 5px 8px 5px 0; vertical-align: top; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.found tr:last-child td { border-bottom: 0; }
.found td:first-child { width: 40%; color: var(--muted); }
.found td:last-child { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--danger) 60%, transparent); }

.faq { margin-top: 40px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; font-size: .92rem; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq ul { padding-left: 18px; }
.faq li { margin-bottom: 6px; }

@media (max-width: 520px) {
  .wrap { padding-top: 32px; }
  .row { flex-wrap: wrap; }
  .dl { width: 100%; }
}
