:root {
  --bg0: #121820;
  --bg1: #1a232e;
  --bg2: #243041;
  --line: #334155;
  --text: #e8eef6;
  --muted: #93a4b8;
  --accent: #3d9c84;
  --accent-2: #f0b429;
  --danger: #e35d6a;
  --ok: #5ecf9a;
  --radius: 14px;
  --font: "Avenir Next", "SF Pro Text", "Segoe UI", sans-serif;
  --mono: "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(900px 420px at 10% -10%, #2a3b4f 0%, transparent 55%),
    radial-gradient(700px 360px at 100% 0%, #1d3a33 0%, transparent 50%),
    var(--bg0);
  color: var(--text);
  font-family: var(--font);
}
.hidden { display: none !important; }
.shell {
  max-width: 520px;
  margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hero {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}
.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
}
h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.02em;
}
.sub {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  max-width: 28ch;
}
.switch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.switch input { position: absolute; opacity: 0; }
.track {
  width: 58px;
  height: 32px;
  border-radius: 999px;
  background: #3a4656;
  position: relative;
}
.track::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #f4f7fb;
  transition: transform 160ms ease;
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(26px); }
.switch-label { font-size: 12px; color: var(--muted); font-weight: 700; }
.card {
  background: color-mix(in srgb, var(--bg1) 90%, black);
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: var(--radius);
  padding: 14px;
}
.card h2 {
  margin: 0 0 12px;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
label { font-size: 12px; color: var(--muted); }
input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--text);
  border-radius: 10px;
  padding: 12px;
  font: inherit;
  font-size: 16px;
}
.hint { margin: 0; font-size: 12px; color: var(--muted); }
.hint.error { color: var(--danger); margin-top: 10px; min-height: 1.2em; }
.status-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.status-top h2 { margin: 0; }
.pill {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  background: #334155;
}
.pill.ok { background: color-mix(in srgb, var(--ok) 25%, #1a232e); color: var(--ok); }
.pill.err { background: color-mix(in srgb, var(--danger) 25%, #1a232e); color: var(--danger); }
.pill.run { background: color-mix(in srgb, var(--accent-2) 28%, #1a232e); color: var(--accent-2); }
.meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 10px; }
.meta div { background: rgba(255,255,255,0.03); border-radius: 10px; padding: 8px 10px; }
.meta dt { margin: 0; font-size: 11px; color: var(--muted); }
.meta dd { margin: 2px 0 0; font-size: 13px; font-weight: 700; }
.log {
  margin: 0;
  min-height: 150px;
  max-height: 220px;
  overflow: auto;
  background: #0e141c;
  border-radius: 10px;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.45;
  color: #c5d2e0;
  white-space: pre-wrap;
}
.actions {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 10px;
  position: sticky;
  bottom: calc(8px + env(safe-area-inset-bottom));
}
button {
  border: 0;
  border-radius: 12px;
  padding: 14px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
}
button:disabled { opacity: 0.5; }
.ghost { background: var(--bg2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.primary { background: linear-gradient(180deg, #4cb299, var(--accent)); color: #04140f; width: 100%; }
