:root {
  --ink: #101a2b; --muted: #56637a; --line: #dde5f0; --page: #f1f5fb; --card: #fff;
  --teal: #0a8f86; --blue: #2257e0; --coral: #e8553a;
  --grad: linear-gradient(100deg, #0a857d 0%, #1f6ad6 60%, #2f4fe0 100%);
  --good: #0d7a4c; --good-bg: #e0f6ea; --bad: #b4281c; --bad-bg: #fdeae6; --info: #1b4fc4; --info-bg: #e6eefd;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: var(--page); color: var(--ink); font: 15px/1.5 "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 24px; }

/* Header */
header {
  position: relative; overflow: hidden; color: #fff; padding: 38px 0 112px;
  background:
    radial-gradient(520px 300px at 88% -10%, rgba(255, 138, 92, .75), transparent 70%),
    radial-gradient(620px 380px at 8% 115%, rgba(22, 205, 180, .70), transparent 70%),
    radial-gradient(560px 340px at 60% 120%, rgba(92, 108, 255, .65), transparent 70%),
    linear-gradient(115deg, #0b1f45 0%, #123a86 55%, #1a2f7d 100%);
}
header .wrap { display: flex; align-items: center; gap: 18px; position: relative; }
.logo { flex: none; width: 58px; height: 58px; border-radius: 16px; box-shadow: 0 8px 22px rgba(4, 14, 40, .35); }
h1 { margin: 0; font: 680 29px/1.15 "Segoe UI Variable Display", "Segoe UI", sans-serif; letter-spacing: -.015em; }
header p { margin: 5px 0 0; color: #dbe6fb; font-size: 16px; }
#edition { display: inline-block; font-size: 13px; font-weight: 600; letter-spacing: 0; color: #fff; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .32); border-radius: 8px; padding: 2px 10px; margin-left: 10px; vertical-align: 5px; }

/* Cards */
main.wrap { margin-top: -78px; padding-bottom: 56px; position: relative; }
.card, .entry { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 22px 24px; margin-bottom: 18px; }
.entry { border: 0; padding: 26px 28px 28px; box-shadow: 0 18px 46px rgba(16, 32, 78, .18); }
.entry label { display: block; font-weight: 640; margin-bottom: 9px; }
.entry label.next { margin-top: 20px; }
.row { display: flex; gap: 12px; }
input[type=text] {
  flex: 1; min-width: 0; font: 17px/1.3 "Cascadia Mono", Consolas, monospace; color: var(--ink);
  padding: 15px 17px; border: 2px solid #d3ddec; border-radius: 13px; background: #f8fafe; transition: border-color .15s, background .15s;
}
input[type=text]:hover { border-color: #b4c5e2; }
input[type=text]:focus { outline: 0; border-color: var(--blue); background: #fff; box-shadow: 0 0 0 4px rgba(34, 87, 224, .16); }
input::placeholder { font-family: "Segoe UI", system-ui, sans-serif; font-size: 15px; color: #6d7a91; }
#code { font-size: 14px; background: #eef3fb; }

button { font: 640 16px/1.3 "Segoe UI", system-ui, sans-serif; padding: 15px 28px; border: 0; border-radius: 13px; color: #fff; background: var(--grad); background-size: 160% 100%; cursor: pointer; white-space: nowrap; box-shadow: 0 8px 20px rgba(31, 90, 214, .32); transition: background-position .35s, box-shadow .2s, transform .1s; }
button:hover { background-position: 100% 0; box-shadow: 0 10px 26px rgba(31, 90, 214, .42); }
button:active { transform: translateY(1px); }
button:focus-visible, summary:focus-visible, .option input:focus-visible { outline: 3px solid #8fb4ff; outline-offset: 2px; }
button:disabled { background: #8b9ab5; box-shadow: none; cursor: default; }
button.quiet { background: none; box-shadow: none; color: var(--muted); padding: 6px 0; font-weight: 400; font-size: 15px; text-decoration: underline; }
button.quiet:hover { color: var(--ink); }

.hint { margin: 12px 0 0; color: var(--muted); }
.entry .option { display: flex; gap: 11px; align-items: flex-start; font-weight: 400; margin: 18px 0 0; cursor: pointer; }
.option input { flex: none; width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--blue); }
.option small { display: block; color: var(--muted); font-size: 14px; }
#lockMsg { margin: 16px 0 0; padding: 12px 16px; border-radius: 12px; background: var(--bad-bg); color: var(--bad); font-weight: 640; }

/* Status */
#status { display: flex; align-items: center; gap: 14px; white-space: pre-line; padding: 16px 20px; border-radius: 16px; margin-bottom: 18px; background: var(--info-bg); color: var(--info); font-weight: 640; }
#status::before { content: ""; flex: none; width: 22px; height: 22px; border-radius: 50%; border: 3px solid currentColor; border-top-color: transparent; animation: spin .9s linear infinite; }
#status.ok, #status.bad { animation: rise .25s ease-out; }
#status.ok { background: linear-gradient(95deg, #d8f5e6, #e2f3fb); color: var(--good); }
#status.bad { background: linear-gradient(95deg, #fde6e1, #fff0e6); color: var(--bad); }
#status.ok::before, #status.bad::before { animation: none; border: 0; width: 26px; height: 26px; color: #fff; font: 700 15px/26px "Segoe UI", sans-serif; text-align: center; }
#status.ok::before { content: "\2713"; background: var(--good); }
#status.bad::before { content: "!"; background: var(--bad); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { transform: translateY(6px); } to { transform: none; } }

/* Work area */
.grid { display: grid; grid-template-columns: 320px 1fr; gap: 18px; margin-bottom: 18px; }
.grid .card { margin-bottom: 0; }
h2 { margin: 0 0 16px; font: 660 18px/1.3 "Segoe UI Variable Display", "Segoe UI", sans-serif; }

#steps { list-style: none; margin: 0; padding: 0; }
#steps li { position: relative; display: flex; gap: 14px; align-items: flex-start; padding: 0 0 20px; color: var(--muted); }
#steps li:last-child { padding-bottom: 0; }
#steps li::before { content: ""; flex: none; z-index: 1; width: 26px; height: 26px; margin-top: -1px; border-radius: 50%; background: #fff; border: 2px solid #c6d2e4; font: 700 14px/22px "Segoe UI", sans-serif; text-align: center; }
#steps li:not(:last-child)::after { content: ""; position: absolute; left: 12px; top: 22px; bottom: -2px; width: 2px; background: #dbe3ef; }
#steps li.done { color: var(--ink); }
#steps li.done::before { content: "\2713"; border: 0; line-height: 26px; color: #fff; background: linear-gradient(135deg, #0a8f86, #2257e0); }
#steps li.done:not(:last-child)::after { background: linear-gradient(#0a8f86, #2257e0); }
#steps li.active { color: var(--ink); font-weight: 640; }
#steps li.active::before { border: 3px solid var(--blue); border-top-color: transparent; animation: spin .9s linear infinite; }
#steps li.failed { color: var(--bad); font-weight: 640; }
#steps li.failed::before { content: "!"; border: 0; line-height: 26px; color: #fff; background: linear-gradient(135deg, #e8553a, #b4281c); }

#found { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#found div { padding: 12px 15px; border-radius: 13px; background: #f5f8fd; min-width: 0; }
#found div.wide { grid-column: 1 / -1; }
#found div.bad { background: linear-gradient(120deg, #fdebe7, #fff4ec); }
#found div.ok { background: linear-gradient(120deg, #e1f6ea, #e8f5fb); }
#found dt { color: var(--muted); font-size: 14px; }
#found dd { margin: 1px 0 0; font-weight: 600; overflow-wrap: anywhere; }
#found .bad dd { color: var(--bad); } #found .ok dd { color: var(--good); }
#found .wide dd { font-weight: 400; }

summary { cursor: pointer; font-weight: 660; }
pre { white-space: pre-wrap; font: 14px/1.6 "Segoe UI", system-ui, sans-serif; margin: 16px 0 0; padding: 16px 18px; border-radius: 13px; background: #f5f8fd; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 14px; }
th, td { padding: 11px 10px 11px 0; border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }
td:nth-child(2) { font-weight: 640; color: var(--info); }

@media (max-width: 780px) {
  .grid { grid-template-columns: 1fr; }
  .row { flex-direction: column; }
  #found { grid-template-columns: 1fr; }
  header { padding: 28px 0 104px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
