:root {
  color-scheme: dark;
  --bg: #0b0c0f;
  --card: #14161b;
  --line: #262a33;
  --text: #eef1f6;
  --muted: #8d95a5;
  --accent: #b7f171;
  --accent-ink: #0b0c0f;
  --amber: #f0b866;
  --red: #ff7b72;
  --blue: #7cc4ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: radial-gradient(1200px 700px at 50% -20%, #1b2030 0%, var(--bg) 60%);
  color: var(--text);
  font: 16px/1.5 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.shell {
  width: min(100%, 460px);
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom));
}

.card {
  background: linear-gradient(180deg, #171a21, var(--card));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 10px 0 8px;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.lede {
  margin: 0 0 24px;
  color: var(--muted);
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0f1116;
  color: var(--text);
  font: inherit;
}

input:focus {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

button,
.button {
  border: 0;
  border-radius: 999px;
  padding: 15px 22px;
  font: inherit;
  font-weight: 650;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.08s ease, opacity 0.15s ease;
}

button:active,
.button:active {
  transform: scale(0.985);
}

button:disabled,
.button[aria-disabled="true"] {
  opacity: 0.4;
  pointer-events: none;
}

.primary {
  width: 100%;
  background: var(--accent);
  color: var(--accent-ink);
}

.ghost {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}

.secondary {
  background: #232833;
  color: var(--text);
}

.danger {
  background: transparent;
  border: 1px solid #4a2b2b;
  color: var(--red);
}

.link {
  padding: 0;
  background: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
}

.orb {
  display: grid;
  place-content: center;
  gap: 2px;
  width: 190px;
  height: 190px;
  margin: 0 auto 22px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.1), transparent 55%),
    #181b22;
  border: 1px solid var(--line);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.45);
  text-align: center;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.orb span {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.orb small {
  color: var(--muted);
  font-size: 12px;
}

.orb[data-state="running"] {
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.22), transparent 55%),
    radial-gradient(circle at 50% 60%, #3f6b22, #17240f);
  border-color: #4f7a2c;
  box-shadow: 0 0 70px rgba(183, 241, 113, 0.18), inset 0 0 50px rgba(0, 0, 0, 0.35);
}

.orb[data-state="starting"] {
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.18), transparent 55%),
    radial-gradient(circle at 50% 60%, #6b4f1e, #241b0e);
  border-color: #7a5c28;
  animation: pulse 1.8s ease-in-out infinite;
}

.orb[data-state="stopping"] {
  opacity: 0.75;
}

.orb[data-state="error"] {
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.15), transparent 55%),
    radial-gradient(circle at 50% 60%, #6b2626, #240e0e);
  border-color: #7a2c2c;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.015);
  }
}

.detail {
  min-height: 44px;
  margin: 0 0 22px;
  color: var(--muted);
  text-align: center;
}

.actions {
  display: grid;
  gap: 10px;
  margin-bottom: 28px;
}

.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: 0 0 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--line);
}

.facts div {
  padding: 14px;
  background: #101217;
}

.facts dt {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.facts dd {
  margin: 4px 0 0;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.note {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
}

.error,
.toast {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #2a1515;
  color: #ffb4ae;
  font-size: 13px;
}

.toast {
  background: #1b2330;
  color: #b9d7ff;
}

.error:empty,
.toast:empty {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
