:root {
  --green: #58f08a;
  --dim: #8aa59a;
  --soft: #c9d6cf;
  --bg: #0b0f0d;
  --panel: #131a16;
  --line: #22302a;
  --edge: #2c3a32;
  --amber: #f0c27b;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #e6efe9;
  background: var(--bg);
  line-height: 1.5;
}

body { margin: 0; }
main { max-width: 440px; margin: 0 auto; padding: 16px 16px 40px; display: flex; flex-direction: column; gap: 18px; box-sizing: border-box; }
main.wide { max-width: 920px; }
h1, h2, p { margin: 0; }
h1 { font-size: 1.5rem; line-height: 1.2; font-weight: 700; }
h2 { font-size: 1.15rem; font-weight: 650; }
a { color: var(--green); }
a:hover { color: #8cf7ae; }
b { color: #e6efe9; }
[hidden] { display: none !important; }

.top { display: flex; align-items: center; gap: 10px; }
.mark { flex: none; width: 32px; height: 32px; border-radius: 8px; }
.brand { font-weight: 650; }
.who { margin-left: auto; display: flex; align-items: center; gap: 4px; min-width: 0; font-size: 0.875rem; color: var(--dim); }
.who .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.card.hi { border-color: var(--green); }
.card.warn { border-color: var(--amber); }
.card.warn .icon-h svg { color: var(--amber); }
.card p { color: var(--soft); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.said-block { display: flex; flex-direction: column; gap: 4px; }
.icon-h { display: flex; align-items: center; gap: 10px; }
.icon-h svg { flex: none; color: var(--green); }
.note, .card p.note { color: var(--dim); font-size: 0.85rem; line-height: 1.4; }
.hint { font-size: 0.8rem; color: var(--dim); line-height: 1.4; }
.centred { text-align: center; align-self: center; }
.mono { font-family: ui-monospace, Consolas, monospace; }

/* While it checks whether you're signed in: the shape of what follows, so nothing jumps. */
.busy { display: flex; align-items: center; gap: 12px; color: var(--soft); }
.spinner { width: 18px; height: 18px; border: 3px solid var(--line); border-top-color: var(--green); border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.bone { display: block; height: 12px; border-radius: 6px; background: #1b2520; }
.bone.tall { height: 48px; border-radius: 10px; }
.bone.short { width: 70%; }
.bone.shorter { width: 55%; }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

.intro { display: flex; flex-direction: column; gap: 12px; }
.hero { border-radius: 14px; overflow: hidden; border: 1px solid #1f2a24; background: #000; }
.hero img { display: block; width: 100%; height: 150px; object-fit: cover; }
.lead { color: var(--soft); }
.pills { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.pills li { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--soft); border: 1px solid var(--edge); border-radius: 999px; padding: 4px 10px; }
.pills svg { color: var(--green); }

button {
  font: inherit;
  font-weight: 600;
  color: var(--bg);
  background: var(--green);
  border: 1px solid var(--green);
  border-radius: 10px;
  padding: 0 18px;
  min-height: 48px;
  cursor: pointer;
}
button.quiet, .button.quiet { color: var(--green); background: transparent; }
button.small { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; min-width: 44px; padding: 0 12px; font-size: 0.875rem; color: #e6efe9; background: var(--bg); border-color: var(--edge); border-radius: 8px; }
button.small.accent { color: var(--green); border-color: var(--green); }
button.link { min-height: 44px; padding: 0; border: 0; background: none; color: var(--green); font-weight: inherit; text-decoration: underline; }
button.back { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; min-height: 44px; padding: 0; border: 0; background: none; color: var(--green); font-weight: 500; }
button:disabled { opacity: 0.6; cursor: default; }
button:focus-visible, input:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--green);
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  color: var(--bg);
  background: var(--green);
  box-sizing: border-box;
}
.button:hover { color: var(--bg); background: #8cf7ae; }
.button.quiet:hover { color: #8cf7ae; background: transparent; }
.button.big { min-height: 52px; font-size: 1.05rem; }

.or { display: flex; align-items: center; gap: 12px; color: var(--dim); font-size: 0.85rem; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--edge); }
.card p.or { color: var(--dim); }

.account { display: flex; flex-direction: column; gap: 14px; }
.account label { display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; color: var(--soft); }
input {
  font: inherit;
  font-size: 1rem;
  color: #e6efe9;
  background: var(--bg);
  border: 1px solid var(--edge);
  border-radius: 10px;
  padding: 0 12px;
  min-height: 48px;
  box-sizing: border-box;
}
.switch { text-align: center; font-size: 0.9rem; }
.alert, .card p.alert { display: block; background: #2a2114; border: 1px solid var(--amber); border-radius: 10px; padding: 10px 12px; color: #f6dcae; font-size: 0.9rem; }
.aside, .card p.aside { display: flex; gap: 10px; align-items: flex-start; background: var(--bg); border: 1px solid var(--edge); border-radius: 10px; padding: 10px 12px; font-size: 0.85rem; }
.aside svg { flex: none; margin-top: 1px; color: var(--dim); }

.code, .card p.code { font: 700 1.9rem/1.2 ui-monospace, Consolas, monospace; letter-spacing: 0.12em; color: var(--green); text-align: center; background: var(--bg); border: 1px dashed #3c5a49; border-radius: 10px; padding: 14px 8px; }

.done { align-items: center; text-align: center; padding: 32px 20px; gap: 16px; }
.done svg { color: var(--green); }
.done h2 { font-size: 1.4rem; font-weight: 700; }
.done .button { align-self: stretch; }

.step, .card p.step { display: flex; gap: 12px; align-items: flex-start; background: var(--bg); border: 1px solid var(--edge); border-radius: 10px; padding: 12px; }
.n { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--green); color: var(--green); font-size: 0.8rem; font-weight: 700; margin-top: 1px; }

.ready { gap: 16px; }
.ready .said-block p { color: var(--soft); font-size: 0.95rem; }
.keys-hint, .card p.keys-hint { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 0.8rem; color: var(--dim); }
.keys-hint span { display: inline-flex; align-items: center; gap: 6px; }
kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border: 1px solid var(--edge); border-bottom-width: 2px; border-radius: 5px; font: inherit; font-size: 0.75rem; color: #e6efe9; background: var(--bg); box-sizing: border-box; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 18px; align-items: start; }
.steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; color: var(--soft); font-size: 0.95rem; }
.step-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; gap: 8px; align-items: stretch; }
.token { display: flex; flex-direction: column; gap: 6px; }
.token label { font-size: 0.85rem; color: var(--soft); }
.token input { flex: 1; min-width: 0; min-height: 44px; border-radius: 8px; font: 0.85rem ui-monospace, Consolas, monospace; }
code { font: 0.85rem ui-monospace, Consolas, monospace; }
.row code { flex: 1; min-width: 0; display: flex; align-items: center; padding: 8px 10px; background: var(--bg); border: 1px solid var(--edge); border-radius: 8px; color: #e6efe9; overflow-wrap: anywhere; }
.qr-row { display: flex; gap: 14px; align-items: center; border-top: 1px solid var(--line); padding-top: 14px; }
.qr-row p { font-size: 0.875rem; }
#qr { flex: none; display: block; background: #fff; border-radius: 8px; image-rendering: pixelated; }
details { border-top: 1px solid var(--line); padding-top: 10px; }
summary { cursor: pointer; color: var(--green); min-height: 32px; font-size: 0.9rem; }
details[open] { display: flex; flex-direction: column; gap: 10px; }
details p { font-size: 0.9rem; }
.hooks {
  margin: 0;
  max-height: 220px;
  overflow: auto;
  padding: 10px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--edge);
  font: 0.75rem ui-monospace, Consolas, monospace;
  white-space: pre;
}
