:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --text: #16202f;
  --muted: #5b6878;
  --border: #dde3ec;
  --brand: #1f5fbf;
  --brand-ink: #ffffff;
  --ok: #17803d;
  --warn: #a15c00;
  --bad: #b42318;
  --radius: 12px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); line-height: 1.5; }
a { color: var(--brand); }

.topbar { display: flex; align-items: center; gap: 10px; padding: 14px 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar img { width: 28px; height: 28px; }
.topbar strong { font-size: 1.05rem; }
.topbar .spacer { flex: 1; }

main { max-width: 640px; margin: 0 auto; padding: 32px 16px 64px; }
main.wide { max-width: 1100px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
h1 { font-size: 1.6rem; margin: 0 0 6px; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
p.lead { color: var(--muted); margin: 0 0 20px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

label { display: block; font-weight: 600; margin-bottom: 6px; }
input[type=text], input[type=password] {
  width: 100%; padding: 12px 14px; font-size: 1rem; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text);
}
input.code { font-size: 1.8rem; letter-spacing: 0.2em; text-align: center; font-variant-numeric: tabular-nums; }
input:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 40%, transparent); outline-offset: 2px; }

button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; font-size: 1rem; font-weight: 600; border-radius: 8px; border: 1px solid var(--brand);
  background: var(--brand); color: var(--brand-ink); cursor: pointer; text-decoration: none;
}
button.secondary, .button.secondary { background: #fff; color: var(--brand); }
button.danger { background: #fff; color: var(--bad); border-color: var(--bad); }
button.small, .button.small { padding: 6px 10px; font-size: 0.85rem; }
button:disabled { opacity: 0.55; cursor: not-allowed; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.stack > * + * { margin-top: 14px; }

.error { color: var(--bad); font-weight: 600; min-height: 1.5em; margin: 8px 0 0; }
.hidden { display: none !important; }

ol.steps { padding-left: 1.3em; margin: 0; }
ol.steps li { margin-bottom: 14px; }

.status { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 8px; background: #eef3fb; font-weight: 600; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--bad); }
.dot.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { .dot.pulse { animation: none; } }

details { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }
summary { cursor: pointer; font-weight: 600; }
code, .mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 0.9em; }
.config-string { word-break: break-all; background: #f0f2f6; padding: 10px; border-radius: 6px; display: block; }

.bigcode { font-size: 2.4rem; font-weight: 700; letter-spacing: 0.12em; font-variant-numeric: tabular-nums; }

table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.table-wrap { overflow-x: auto; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; background: #eef1f5; color: var(--muted); white-space: nowrap; }
.pill.ok { background: #e6f4ea; color: var(--ok); }
.pill.warn { background: #fdf1e0; color: var(--warn); }
.pill.brand { background: #e7effb; color: var(--brand); }

footer { text-align: center; color: var(--muted); font-size: 0.85rem; padding: 24px 16px; }
.mt { margin-top: 18px; }
.spacer { flex: 1; }
.grow { flex: 1; min-width: 220px; width: auto !important; }
.row h2 { margin: 0; }
.notice { border-color: var(--warn); background: #fffaf2; }
