:root {
  --bg: #070b14;
  --card: #101828;
  --line: #243044;
  --text: #e7eefc;
  --muted: #93a0b8;
  --accent: #56e39f;
  --accent-dim: #1f8f5f;
  --warn: #f0b429;
  --danger: #ff6b7a;
  --ok: #56e39f;
  --shadow: 0 20px 60px rgba(0,0,0,.45);
  font-family: "Segoe UI", ui-sans-serif, system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--accent); }
.bg {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(86,227,159,.16), transparent 60%),
    radial-gradient(700px 400px at 90% 0%, rgba(88,140,255,.12), transparent 55%),
    linear-gradient(180deg, #070b14, #0a1220 40%, #070b14);
}
.shell { position: relative; z-index: 1; max-width: 980px; margin: 0 auto; padding: 28px 18px 60px; }
.top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 20px; flex-wrap: wrap; }
.brand { display: flex; gap: 14px; align-items: center; }
.logo {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(145deg, #152238, #0d1626);
  border: 1px solid var(--line);
  box-shadow: inset 0 0 0 1px rgba(86,227,159,.2);
  position: relative;
}
.logo::before, .logo::after {
  content: ""; position: absolute; background: var(--accent); border-radius: 3px;
}
.logo::before { width: 18px; height: 4px; left: 13px; top: 20px; }
.logo::after { width: 4px; height: 18px; left: 20px; top: 13px; }
h1 { margin: 0; font-size: 1.45rem; letter-spacing: .02em; }
h2 { margin: 0 0 12px; font-size: 1.05rem; }
.sub { margin: 4px 0 0; color: var(--muted); font-size: .9rem; }
.pillrow { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 999px; font-size: .78rem;
  border: 1px solid var(--line); background: rgba(16,24,40,.8); color: var(--muted);
}
.pill.ok { color: var(--ok); border-color: rgba(86,227,159,.35); }
.pill.warn { color: var(--warn); border-color: rgba(240,180,41,.35); }
.pill.danger { color: var(--danger); border-color: rgba(255,107,122,.35); }
.card {
  background: linear-gradient(180deg, rgba(22,32,52,.95), rgba(16,24,40,.92));
  border: 1px solid var(--line); border-radius: 18px; padding: 18px;
  box-shadow: var(--shadow); margin-bottom: 16px;
}
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 800px) { .grid { grid-template-columns: 1fr; } }
.power-card .power-wrap { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.power {
  width: 112px; height: 56px; border-radius: 999px; border: 1px solid var(--line);
  background: #0b1322; position: relative; cursor: pointer; transition: .2s ease;
  padding: 0; color: var(--muted); font-weight: 700; letter-spacing: .08em;
}
.power[aria-pressed="true"] {
  background: linear-gradient(90deg, rgba(31,143,95,.35), rgba(86,227,159,.25));
  border-color: rgba(86,227,159,.5); color: var(--accent);
}
.power .knob {
  position: absolute; top: 6px; left: 6px; width: 42px; height: 42px; border-radius: 50%;
  background: #d7e2f5; transition: .2s ease; box-shadow: 0 6px 16px rgba(0,0,0,.35);
}
.power[aria-pressed="true"] .knob { left: 62px; background: var(--accent); }
.power .label { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: .75rem; }
.power[aria-pressed="true"] .label { right: auto; left: 14px; }
.status-line { margin: 14px 0 0; color: var(--muted); font-size: .9rem; min-height: 1.2em; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; font-size: .86rem; color: var(--muted); }
.field em { font-style: normal; opacity: .75; }
input {
  width: 100%; border-radius: 12px; border: 1px solid var(--line); background: #0a1220;
  color: var(--text); padding: 12px 14px; font-size: .95rem; outline: none;
}
input:focus { border-color: rgba(86,227,159,.55); box-shadow: 0 0 0 3px rgba(86,227,159,.12); }
.btn {
  border: 0; border-radius: 12px; padding: 11px 16px; font-weight: 650; cursor: pointer;
  background: linear-gradient(180deg, #63ebb0, #2fbf7f); color: #062416;
}
.btn:hover { filter: brightness(1.05); }
.btn.secondary { background: #182338; color: var(--text); border: 1px solid var(--line); }
.row { display: flex; gap: 8px; align-items: center; }
.row.between { justify-content: space-between; align-items: center; }
.row input { flex: 1; }
.muted { color: var(--muted); font-size: .88rem; }
.key-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 12px; min-height: 28px; }
.key-item {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 10px; background: #0a1220; border: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem;
}
.key-item button {
  border: 0; background: transparent; color: var(--danger); cursor: pointer; font-size: .8rem;
}
.linkish {
  border: 0; background: transparent; color: var(--accent); cursor: pointer; padding: 0;
  font-size: .85rem;
}
.table-wrap { overflow: auto; border-radius: 12px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: .84rem; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; background: rgba(0,0,0,.2); }
tbody tr:hover { background: rgba(86,227,159,.04); }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .72rem;
  border: 1px solid var(--line); color: var(--muted);
}
.badge.running { color: var(--ok); border-color: rgba(86,227,159,.4); }
.badge.done { color: #8eb6ff; border-color: rgba(142,182,255,.35); }
.badge.error { color: var(--danger); border-color: rgba(255,107,122,.35); }
.badge.stopped { color: var(--warn); border-color: rgba(240,180,41,.35); }
footer { margin-top: 8px; color: var(--muted); font-size: .8rem; text-align: center; }
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: #152238; border: 1px solid var(--line); color: var(--text);
  padding: 10px 16px; border-radius: 12px; box-shadow: var(--shadow); z-index: 20;
}
.toast.err { border-color: rgba(255,107,122,.45); }
