:root {
  --bg: #f4f5f7; --card: #fff; --text: #111827; --muted: #6b7280; --line: #e5e7eb;
  --brand: #0655cb; --brand-ink: #fff; --danger: #c81e1e; --warn: #b45309; --ok: #047857;
  --radius: 10px; font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0b0f17; --card: #141a24; --text: #e5e7eb; --muted: #9ca3af; --line: #263041; --brand: #4c8dff; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }
header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; background: #0f172a; color: #fff; }
header h1 { margin: 0; font-size: 17px; font-weight: 600; }
header .who { font-size: 13px; opacity: .85; display: flex; gap: 10px; align-items: center; }
main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; }
.narrow { max-width: 560px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.card h2 { margin: 0 0 4px; font-size: 16px; }
.card p.hint, .hint { color: var(--muted); font-size: 13px; margin: 2px 0 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password] {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); font-size: 14px;
}
input:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: transparent; }
.suffix { display: flex; }
.suffix input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.suffix span { padding: 9px 10px; border: 1px solid var(--line); border-left: 0; border-radius: 0 8px 8px 0; color: var(--muted); font-size: 14px; white-space: nowrap; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
button, .button {
  display: inline-block; border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 8px;
  padding: 8px 14px; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none;
}
button.primary, .button.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
button.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
button.danger.solid { background: var(--danger); color: #fff; }
button.small { padding: 4px 10px; font-size: 12px; }
button:disabled { opacity: .5; cursor: not-allowed; }
header button { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--line); }
td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.right { text-align: right; white-space: nowrap; }
.scroll { overflow-x: auto; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--line); color: var(--muted); }
.badge.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.badge.bad { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.badge.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.notice { border-radius: 8px; padding: 10px 12px; font-size: 14px; margin-bottom: 14px; }
.notice.error { background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); }
.notice.warn { background: color-mix(in srgb, var(--warn) 12%, transparent); color: var(--warn); }
.notice.ok { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }
.hidden { display: none !important; }
dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--text); padding: 20px; width: min(480px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0,0,0,.45); }
dialog h3 { margin: 0 0 8px; }
.qr { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin: 6px 0 14px; }
.qr img { width: 180px; height: 180px; background: #fff; padding: 8px; border-radius: 8px; border: 1px solid var(--line); }
.secret { font-family: ui-monospace, Consolas, monospace; font-size: 14px; letter-spacing: .06em; word-break: break-all; }
ol.steps { padding-left: 20px; margin: 6px 0 14px; }
details summary { cursor: pointer; font-weight: 600; }
.center { text-align: center; }
@media (max-width: 640px) { header { flex-direction: column; align-items: flex-start; } td.right { white-space: normal; } }
