:root {
  --bg: #f5f6f8; --bg-2: #eceef3; --card: #ffffff; --text: #0f172a; --muted: #64748b; --border: #e2e8f0;
  --accent: #4f46e5; --accent-2: #4338ca; --accent-soft: #eef2ff;
  --err-bg: #fef2f2; --err: #b91c1c; --ok-bg: #ecfdf5; --ok: #047857; --note-bg: #f8fafc;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 12px 32px -8px rgba(15,23,42,.12);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d12; --bg-2: #11141b; --card: #151922; --text: #e8ebf1; --muted: #94a3b8; --border: #262c38;
    --accent: #818cf8; --accent-2: #6366f1; --accent-soft: #1e1f3b;
    --err-bg: #2a1416; --err: #fca5a5; --ok-bg: #0c2a20; --ok: #6ee7b7; --note-bg: #10141b;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 32px -8px rgba(0,0,0,.5);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(1200px 600px at 50% -10%, var(--accent-soft), transparent 70%), var(--bg);
  color: var(--text); font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.card {
  width: 100%; max-width: 440px; background: var(--card); border: 1px solid var(--border); border-radius: 20px;
  padding: 36px 32px; box-shadow: var(--shadow);
}
.card.wide { max-width: 580px; }
.icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 18px;
  background: var(--accent-soft); color: var(--accent);
}
.icon.ok-icon { background: var(--ok-bg); color: var(--ok); }
.icon.err-icon { background: var(--err-bg); color: var(--err); }
.icon svg { width: 26px; height: 26px; }
h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; margin: 0 0 6px; }
p { color: var(--muted); margin: 0 0 24px; }
label.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
input {
  width: 100%; font: 600 1.5rem ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .18em; text-align: center;
  text-transform: uppercase; padding: 16px; border: 1.5px solid var(--border); border-radius: 12px;
  background: var(--note-bg); color: var(--text); transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: var(--muted); opacity: .5; }
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: var(--card); }
button, .btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 14px; padding: 15px;
  font: inherit; font-size: 1rem; font-weight: 600; text-decoration: none; color: #fff; background: var(--accent);
  border: 0; border-radius: 12px; cursor: pointer; transition: background .15s, transform .05s;
}
button:hover, .btn:hover { background: var(--accent-2); }
button:active, .btn:active { transform: translateY(1px); }
button:disabled { opacity: .65; cursor: default; }
.btn.secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn.secondary:hover { background: var(--note-bg); }
.btn svg, button svg { width: 18px; height: 18px; }
.alert { display: flex; gap: 10px; background: var(--err-bg); color: var(--err); padding: 12px 14px; border-radius: 12px; margin: 0 0 18px; font-weight: 500; font-size: .95rem; }
.ok { background: var(--ok-bg); color: var(--ok); padding: 12px 14px; border-radius: 12px; font-size: .95rem; }
.file { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin: 18px 0 0; }
.file .fi { flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.file .fi svg { width: 20px; height: 20px; }
.file div { min-width: 0; }
.file strong { display: block; overflow-wrap: anywhere; font-weight: 600; }
.file span { color: var(--muted); font-size: .85rem; }
.notes { margin-top: 22px; }
.notes h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; margin: 0 0 8px; }
.notes .text { background: var(--note-bg); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; white-space: pre-wrap; overflow-wrap: anywhere; }
.notes a { color: var(--accent); }
small { display: block; margin-top: 16px; color: var(--muted); text-align: center; font-size: .85rem; }

@media (max-width: 480px) {
  body { place-items: start center; padding: 16px; }
  .card { padding: 28px 20px; border-radius: 18px; margin-top: 4vh; }
  h1 { font-size: 1.3rem; }
  input { font-size: 1.3rem; letter-spacing: .12em; }
}
