:root {
  --bg: #f3f4f6;
  --panel: #ffffff;
  --line: #d4d7dc;
  --text: #1f2328;
  --muted: #5b6270;
  --bar: #1f2328;
  --blue: #0b5cad;
  --blue-dark: #094a8c;
  --ok: #1a7f37;
  --bad: #b42318;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}

.topbar { background: var(--bar); color: #fff; }
.topbar-inner, main, .footer-inner { width: 100%; max-width: 760px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
.topbar-inner { display: flex; align-items: center; gap: 12px; height: 52px; }
.brand { display: block; height: 23px; width: auto; }
.product { font-weight: 600; padding-left: 12px; border-left: 1px solid #4a4f57; }
.secure { margin-left: auto; font-size: 13px; color: #c9ccd1; }

main { flex: 1; padding-top: 32px; padding-bottom: 32px; }
h1 { font-size: 24px; font-weight: 600; margin: 0 0 4px; }
.intro { color: var(--muted); margin: 0 0 24px; }
h2 { font-size: 17px; font-weight: 600; margin: 0 0 16px; }

.stepper { display: flex; list-style: none; padding: 0; margin: 0 0 16px; border: 1px solid var(--line); background: var(--panel); counter-reset: step; }
.stepper li { flex: 1; padding: 10px 12px; font-size: 14px; color: var(--muted); counter-increment: step; }
.stepper li + li { border-left: 1px solid var(--line); }
.stepper li::before { content: counter(step) ". "; }

body[data-step="step-code"] .stepper [data-for="step-code"],
body[data-step="step-verify"] .stepper [data-for="step-verify"],
body[data-step="step-receive"] .stepper [data-for="step-receive"],
body[data-step="step-done"] .stepper [data-for="step-done"] {
  color: var(--text);
  font-weight: 600;
  box-shadow: inset 0 -3px 0 var(--blue);
}

.panel { background: var(--panel); border: 1px solid var(--line); padding: 24px; }
.panel.error { border-color: var(--bad); border-left-width: 4px; }
.panel.error h2 { color: var(--bad); }
.panel p { margin: 0 0 12px; }

.code-row { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; margin-bottom: 12px; }
.code {
  display: inline-block;
  font: 600 44px/1 Consolas, "Cascadia Mono", ui-monospace, monospace;
  letter-spacing: 6px;
  padding: 14px 20px;
  border: 1px solid var(--line);
  background: #f8f9fa;
  margin-bottom: 16px;
}
.code-row .code { margin-bottom: 0; }
.instructions { margin: 0; padding-left: 20px; }
.instructions li { margin: 2px 0; }

.note { color: var(--muted); font-size: 14px; }
.status { font-weight: 600; }

.progress { height: 8px; background: #e5e7eb; margin-bottom: 12px; }
.progress div { height: 100%; width: 0; background: var(--blue); transition: width 0.2s; }

.files { list-style: none; padding: 0; margin: 16px 0; border: 1px solid var(--line); }
.files:empty { display: none; }
.files li { padding: 10px 12px; }
.files li + li { border-top: 1px solid var(--line); }
.files .name { font-weight: 600; word-break: break-all; }
.files .meta { color: var(--muted); font: 12px/1.4 Consolas, ui-monospace, monospace; word-break: break-all; }
.files .ok, .files .bad { font-weight: 600; white-space: nowrap; word-break: normal; }
.files .ok { color: var(--ok); }
.files .bad { color: var(--bad); }

.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
button {
  font: inherit;
  font-weight: 600;
  padding: 8px 18px;
  min-height: 36px;
  border-radius: 3px;
  border: 1px solid transparent;
  cursor: pointer;
}
button:disabled { opacity: 0.6; cursor: default; }
button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.primary { background: var(--blue); color: #fff; }
.primary:hover:not(:disabled) { background: var(--blue-dark); }
.secondary { background: #fff; color: var(--text); border-color: #a9aeb6; }
.secondary:hover:not(:disabled) { background: #f0f1f3; }

footer { border-top: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 13px; }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }

@media (max-width: 560px) {
  .secure { display: none; }
  .stepper li { font-size: 12px; padding: 8px 6px; }
}
