:root {
  color-scheme: dark;
  --bg: #050814;
  --panel: #0b152c;
  --elevated: #10203f;
  --border: #16324f;
  --text: #e8f7ff;
  --muted: #8fb4c9;
  --accent: #22d3ee;
  --accent-fg: #041018;
  --focus: #22d3ee;
  --pass: #4ade80;
  --pass-bg: color-mix(in srgb, #4ade80 14%, var(--panel));
  --fail: #fbbf24;
  --fail-bg: color-mix(in srgb, #fbbf24 12%, var(--panel));
  --radius: 14px;
  --radius-sm: 10px;
  --hit: 44px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Outfit, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  padding: 0.75rem 0.85rem calc(1.5rem + env(safe-area-inset-bottom));
  max-width: 40rem;
  margin: 0 auto;
}

.skip {
  position: absolute;
  inset-inline-start: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-fg);
  padding: 0.5rem 0.75rem;
  z-index: 50;
  font-weight: 700;
}
.skip:focus { inset-inline-start: 0.5rem; top: 0.5rem; }

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--text);
  min-height: var(--hit);
  padding: 0.15rem 0.25rem;
  border-radius: var(--radius-sm);
}
.brand img { border-radius: 10px; flex-shrink: 0; }
.brand strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.brand .chip,
.chip {
  display: inline-flex;
  align-items: center;
  margin-top: 0.1rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  background: color-mix(in srgb, var(--panel) 90%, transparent);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  font-style: normal;
  letter-spacing: 0.02em;
}

.top-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: var(--hit);
  min-width: var(--hit);
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--elevated);
  color: var(--text);
  font: inherit;
  font-weight: 650;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
}
.btn .ico { font-size: 0.95rem; line-height: 1; opacity: 0.9; }
.btn:focus-visible,
.brand:focus-visible,
.step:focus-visible,
.choice:focus-visible,
.alias-input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
.btn.ghost {
  background: transparent;
  border-color: color-mix(in srgb, var(--border) 80%, transparent);
  color: var(--muted);
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
}
.btn.primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn.xl {
  min-height: 48px;
  padding: 0.7rem 1.25rem;
  font-size: 1.02rem;
  border-radius: 12px;
}

.help {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.05rem 0.95rem;
  margin: 0 0 1rem;
}
.help h2 { margin: 0 0 0.45rem; font-size: 1.05rem; }
.help-sub {
  margin: 0.85rem 0 0.4rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--muted);
}
.help-loop {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text);
  line-height: 1.45;
  font-weight: 550;
}
.help-loop li { margin: 0.2rem 0; }
.stuck {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin: 0.25rem 0 0.5rem;
}
.stuck th, .stuck td {
  text-align: left;
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.35;
}
.stuck th {
  background: var(--elevated);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.alias-note { margin: 0.55rem 0 0; }
.whats-new {
  margin: 0.5rem 0 0;
  color: var(--text);
  font-weight: 600;
  line-height: 1.45;
}
.quiet {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.progress {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.title {
  margin: 0 0 0.35rem;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.lede {
  margin: 0 0 1rem;
  color: var(--muted);
  line-height: 1.5;
  font-weight: 500;
}
.panel {
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 0.85rem 0.95rem;
  margin: 0 0 0.85rem;
}
.panel-label {
  display: block;
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.hint {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 550;
  line-height: 1.4;
}

.alias-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.alias-input {
  flex: 1 1 10rem;
  min-height: var(--hit);
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-weight: 550;
}

.steps, .choices {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.step, .choice {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  width: 100%;
  min-height: var(--hit);
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-weight: 550;
  text-align: left;
  cursor: pointer;
  line-height: 1.35;
}
.step:hover, .choice:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}
.step.is-selected, .choice.is-selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--panel));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}
.step-num {
  flex: 0 0 1.6rem;
  width: 1.6rem;
  height: 1.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--elevated);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 800;
  margin-top: 0.05rem;
}
.step-text, .choice-text { flex: 1; }
.choice-mark {
  flex: 0 0 1.1rem;
  color: var(--accent);
  font-size: 0.95rem;
  line-height: 1.4;
}

.result {
  margin: 0 0 0.85rem;
  padding: 0.85rem 0.9rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  line-height: 1.45;
  font-weight: 550;
}
.result.pass {
  border-color: color-mix(in srgb, var(--pass) 45%, var(--border));
  background: var(--pass-bg);
  color: var(--text);
}
.result.pass strong { color: var(--pass); }
.result.fail {
  border-color: color-mix(in srgb, var(--fail) 45%, var(--border));
  background: var(--fail-bg);
  color: var(--text);
}
.result.fail strong { color: var(--fail); }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0.25rem 0 0.75rem;
}

.done-banner {
  margin: 0.5rem 0 0;
  padding: 0.85rem 0.9rem;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  background: color-mix(in srgb, var(--accent) 10%, var(--panel));
  color: var(--text);
  font-weight: 600;
  line-height: 1.45;
}

.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 1.25rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}
code {
  font-size: 0.85em;
  color: var(--accent);
}
@media (min-width: 640px) {
  body { padding-top: 1rem; }
  .title { font-size: 1.65rem; }
}


/* v0.1.1 — drawer lives in chrome.js. Keep steps top to bottom in RTL. */
html[dir="rtl"] .step,
html[dir="rtl"] .choice { text-align: start; }
.step-num { direction: ltr; }
