:root {
  --bg: #ffffff;
  --ink: #111111;
  --muted: #6b6b6b;
  --line: #e6e6e6;
  --soft: #f7f7f7;
  --accent: #111111;
  --accent-ink: #ffffff;
  --bad: #c62828;
  --ok: #1e8e5a;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0f10; --ink: #f2f2f2; --muted: #9a9a9a; --line: #262628; --soft: #17171a;
    --accent: #f2f2f2; --accent-ink: #0f0f10;
  }
}
:root[data-theme="dark"] {
  --bg: #0f0f10; --ink: #f2f2f2; --muted: #9a9a9a; --line: #262628; --soft: #17171a;
  --accent: #f2f2f2; --accent-ink: #0f0f10;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font: 16px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.wrap { min-height: 100%; max-width: 640px; margin: 0 auto; padding: 24px 16px 40px; display: flex; flex-direction: column; }

.top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 48px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.01em; font-size: 17px; }
.logo { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; display: block; }
.status { font-size: 12px; color: var(--muted); }
.status.ok::before, .status.bad::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: var(--ok);
}
.status.bad::before { background: var(--bad); }

h1 { font-size: clamp(28px, 6vw, 40px); line-height: 1.12; letter-spacing: -.03em; font-weight: 700; margin: 0 0 28px; }

.drop {
  display: block; border: 1.5px dashed var(--line); border-radius: 16px; background: var(--soft);
  padding: 56px 20px; text-align: center; cursor: pointer; color: var(--muted);
  transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--ink); color: var(--ink); }
.drop-inner { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.drop-title { font-weight: 600; color: var(--ink); }
.drop-sub { font-size: 13px; }

.note { font-size: 13px; color: var(--muted); margin: 14px 2px 0; }
.err { font-size: 14px; color: var(--bad); margin: 14px 2px 0; }

.working { text-align: center; }
.working img { width: 100%; border-radius: 16px; opacity: .35; filter: saturate(.6); display: block; }
.working-text { margin-top: 16px; color: var(--muted); font-size: 14px; display: inline-flex; align-items: center; gap: 10px; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--ink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.result img { width: 100%; border-radius: 16px; display: block; background: var(--soft); }
.actions { display: flex; gap: 10px; margin-top: 16px; }
.btn {
  flex: 1; font: inherit; font-weight: 600; font-size: 15px; text-align: center; text-decoration: none;
  padding: 13px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer;
}
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.foot { margin-top: auto; padding-top: 48px; font-size: 12px; color: var(--muted); text-align: center; }
