:root {
  color-scheme: dark;
  --bg: #050505;
  --panel: rgba(20, 20, 20, .86);
  --panel-2: #161616;
  --text: #f4f4f4;
  --muted: #929292;
  --border: rgba(255,255,255,.10);
  --accent: #f2f2f2;
  --accent-text: #090909;
  --danger: #ff8d8d;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 50% -15%, rgba(255,255,255,.11), transparent 35%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.shell {
  min-height: 100dvh;
  width: min(100%, 680px);
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
  display: grid;
  place-content: center;
  gap: 18px;
}
.card {
  border: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 28px;
  padding: 24px;
  box-shadow: 0 30px 90px rgba(0,0,0,.45);
}
.brand-row { display: flex; align-items: center; gap: 14px; }
.brandmark {
  width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-text); font-weight: 800; font-size: 25px;
}
.brandmark.small { width: 40px; height: 40px; border-radius: 13px; }
.eyebrow { margin: 0 0 2px; color: var(--muted); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
h1 { margin: 0; font-size: 34px; letter-spacing: -.045em; line-height: 1; }
.lead { margin: 28px 0 24px; color: #d8d8d8; font-size: clamp(20px, 6vw, 30px); line-height: 1.06; letter-spacing: -.04em; max-width: 500px; }
.form { display: grid; gap: 12px; }
.field { display: grid; gap: 8px; }
.field > span { color: var(--muted); font-size: 13px; }
.input-wrap { position: relative; }
input {
  width: 100%; min-height: 58px; border-radius: 16px; border: 1px solid var(--border);
  background: var(--panel-2); color: var(--text); outline: none; padding: 0 104px 0 16px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus { border-color: rgba(255,255,255,.32); box-shadow: 0 0 0 4px rgba(255,255,255,.05); }
.paste {
  position: absolute; right: 8px; top: 8px; bottom: 8px; border: 0; border-radius: 11px;
  background: #252525; color: #ddd; padding: 0 14px; cursor: pointer;
}
.primary {
  min-height: 58px; border: 0; border-radius: 16px; background: var(--accent); color: var(--accent-text);
  font-weight: 720; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
}
.primary:disabled { opacity: .55; cursor: default; }
.spinner { display:none; width: 16px; height:16px; border: 2px solid rgba(0,0,0,.25); border-top-color:#000; border-radius:50%; animation:spin .8s linear infinite; }
.loading .spinner { display:inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.status { min-height: 20px; margin-top: 14px; color: var(--muted); font-size: 14px; }
.status.error { color: var(--danger); }
.results { display: grid; gap: 10px; }
.result {
  border: 1px solid var(--border); background: #111; border-radius: 16px; padding: 12px;
  display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center;
}
.result .kind { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.result strong { display: block; margin-top: 2px; font-size: 15px; }
.download {
  text-decoration: none; color: #000; background: #f1f1f1; padding: 11px 13px; border-radius: 12px; font-weight: 700; font-size: 14px;
}
.meta { display:flex; gap:8px; flex-wrap:wrap; color:#6f6f6f; font-size:12px; margin-top:20px; }
.fineprint { margin:0 auto; color:#666; font-size:11px; text-align:center; max-width:560px; line-height:1.4; padding:0 12px; }
dialog { border:0; padding:0; background:transparent; color:inherit; }
dialog::backdrop { background:rgba(0,0,0,.75); backdrop-filter: blur(10px); }
.pin-card { width:min(calc(100vw - 36px), 400px); background:#111; border:1px solid var(--border); border-radius:24px; padding:22px; display:grid; gap:14px; box-shadow:0 30px 90px rgba(0,0,0,.55); }
.pin-card h2 { margin:2px 0 0; }
.pin-card p { margin:0; color:var(--muted); font-size:14px; line-height:1.4; }
.pin-card input { padding:0 14px; }
.error { color:var(--danger)!important; min-height:18px; }
@media (max-width: 520px) {
  .shell { place-content: start center; padding-top: max(64px, env(safe-area-inset-top)); }
  .card { border-radius: 24px; padding: 20px; }
  .lead { margin-top: 26px; }
}
