:root {
  color-scheme: dark;
  --bg: #070c0c;
  --panel: #101817;
  --panel-2: #16211f;
  --line: #2a3936;
  --line-strong: #49615d;
  --text: #eef4ef;
  --muted: #91a19c;
  --accent: #dca846;
  --accent-ink: #1d1609;
  --cyan: #3bd6c6;
  --bad: #ff6d5f;
  --radius: 8px;
  --mono: "SFMono-Regular", "JetBrains Mono", "Menlo", monospace;
  --sans: "Aptos", "Segoe UI", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; max-width: 100%; overflow-x: hidden; background: var(--bg); color: var(--text); font-family: var(--sans); }
body {
  background-image:
    linear-gradient(rgba(59, 214, 198, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 214, 198, 0.04) 1px, transparent 1px);
  background-size: 72px 72px;
}
button, a, input { font: inherit; }
.shell { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 392px) minmax(0, 1fr); min-width: 0; }
.rail { border-right: 1px solid var(--line); background: rgba(10, 18, 17, 0.94); padding: 28px 20px; min-width: 0; }
.brand { display: flex; gap: 14px; align-items: center; margin-bottom: 24px; }
.mark { width: 56px; height: 56px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: var(--radius); color: var(--accent); font-weight: 800; letter-spacing: 0; background: #14201f; }
h1, h2, h3, p { margin: 0; letter-spacing: 0; }
h1 { font-size: 28px; line-height: 1; }
h2 { font-size: 22px; line-height: 1.15; margin-top: 4px; }
h3 { font-size: 24px; line-height: 1.16; margin: 3px 0 8px; }
.eyebrow, .label { color: var(--cyan); font-family: var(--mono); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.muted { color: var(--muted); line-height: 1.55; min-width: 0; overflow-wrap: anywhere; word-break: break-all; }
.panel { border: 1px solid var(--line); background: linear-gradient(180deg, var(--panel), rgba(16, 24, 23, 0.76)); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; min-width: 0; }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; padding: 9px 0; border-bottom: 1px solid rgba(73, 97, 93, 0.3); min-width: 0; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.kv strong { font-family: var(--mono); font-size: 12px; text-align: right; min-width: 0; overflow-wrap: anywhere; word-break: break-all; }
.scope { margin: 14px 0 0; padding-left: 18px; color: var(--muted); line-height: 1.7; font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }
.scope li { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.workspace { padding: 28px 26px 48px; }
.topbar { display: flex; align-items: start; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); padding-bottom: 24px; margin-bottom: 28px; }
.topbar h2 { font-size: 34px; }
.stage { display: grid; grid-template-columns: 64px minmax(0, 720px); gap: 20px; align-items: start; margin-bottom: 18px; }
.step-index { font-family: var(--mono); color: var(--accent); border: 1px solid var(--line); border-radius: var(--radius); min-height: 56px; display: grid; place-items: center; background: #111b1a; }
.step-body { border: 1px solid var(--line); background: rgba(16, 24, 23, 0.92); border-radius: var(--radius); padding: 22px; box-shadow: 0 18px 60px rgba(0,0,0,0.22); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.login-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 16px; }
.login-grid label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-family: var(--mono); min-width: 0; }
.login-grid input { width: 100%; min-width: 0; min-height: 42px; border: 1px solid var(--line-strong); border-radius: 6px; background: #07100f; color: var(--text); padding: 0 12px; outline: none; }
.login-grid input:focus { border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(59, 214, 198, 0.18); }
button, .secondary, .ghost {
  min-height: 42px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  padding: 0 15px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 800; }
.secondary { background: #172523; color: var(--text); }
.ghost { background: transparent; color: var(--text); }
.disabled, button:disabled { opacity: 0.45; pointer-events: none; }
.result, .log { margin: 16px 0 0; padding: 14px; border-radius: var(--radius); background: #080e0d; border: 1px solid var(--line); color: #c6d2ce; font-family: var(--mono); font-size: 12px; line-height: 1.55; overflow: auto; white-space: pre-wrap; }
.log { min-height: 90px; }
[data-state="bad"] { color: var(--bad); }
[data-state="ok"] { color: var(--cyan); }

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .rail { border-right: 0; border-bottom: 1px solid var(--line); }
  .kv { grid-template-columns: 1fr; gap: 4px; }
  .kv strong { text-align: left; }
  .workspace { padding: 22px 14px 36px; }
  .topbar { display: block; }
  .topbar .ghost { margin-top: 16px; }
  .stage { grid-template-columns: 1fr; }
  .step-index { width: 56px; }
  .login-grid { grid-template-columns: 1fr; }
}
