:root {
  --bg: #f4f5fb;
  --card: #ffffff;
  --fg: #1b1b21;
  --muted: #55566a;
  --line: #d4d6e4;
  --accent: #4a5c92;
  --ok: #0f8a5f;
  --err: #b3261e;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1117;
    --card: #1a1d27;
    --fg: #eceef6;
    --muted: #a6a9bc;
    --line: #343849;
    --accent: #b4c4ff;
    --ok: #4cd6a0;
    --err: #ffb4ab;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.card {
  width: 100%;
  max-width: 440px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 24px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}
.app-name { margin: 0 0 4px; color: var(--muted); font-size: 0.85rem; font-weight: 600; letter-spacing: 0.02em; }
h1 { margin: 0 0 12px; font-size: 1.35rem; line-height: 1.3; }
p { margin: 0 0 16px; }
.box {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 64px;
  margin: 8px 0 12px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.box:hover:not(:disabled) { border-color: var(--accent); }
.box:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.box:disabled { cursor: not-allowed; opacity: 0.6; }
.tick {
  flex: none;
  width: 28px;
  height: 28px;
  border: 2px solid var(--muted);
  border-radius: 6px;
  display: grid;
  place-items: center;
}
.box[data-state="busy"] .tick {
  border-color: var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.box[data-state="done"] .tick { border-color: var(--ok); background: var(--ok); }
.box[data-state="done"] .tick::after {
  content: "";
  width: 8px;
  height: 14px;
  border: solid var(--card);
  border-width: 0 3px 3px 0;
  transform: translateY(-2px) rotate(45deg);
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .box[data-state="busy"] .tick { animation-duration: 2.4s; }
}
.msg { min-height: 1.5em; margin: 0 0 12px; color: var(--muted); }
.msg.ok { color: var(--ok); }
.msg.error { color: var(--err); }
.small { margin: 16px 0 0; font-size: 0.8rem; color: var(--muted); }
.small a { color: var(--accent); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
