/* Goose Lab — shared "electric deep purple" theme */
:root {
  --bg: #06020d;
  --bg-2: #0b0418;
  --panel: rgba(20, 9, 42, 0.72);
  --panel-solid: #120727;
  --panel-2: rgba(33, 14, 66, 0.55);
  --line: rgba(167, 139, 250, 0.14);
  --line-2: rgba(167, 139, 250, 0.3);
  --text: #f1ecff;
  --muted: #a99bd6;
  --dim: #6d6196;
  --violet: #7c3aed;
  --electric: #a855f7;
  --neon: #d946ef;
  --hot: #f5b8ff;
  --ice: #c4b5fd;
  --blue: #7c8cff;
  --ok: #7cf5c8;
  --warn: #ffb86b;
  --glow: 0 0 22px rgba(168, 85, 247, 0.45);
  --glow-strong: 0 0 28px rgba(217, 70, 239, 0.6), 0 0 6px rgba(245, 184, 255, 0.8);
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  --r: 12px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--text);
  font: 14px/1.5 var(--sans);
  background:
    radial-gradient(1100px 620px at 12% -12%, rgba(124, 58, 237, 0.26), transparent 62%),
    radial-gradient(900px 560px at 108% 4%, rgba(217, 70, 239, 0.13), transparent 60%),
    radial-gradient(800px 500px at 50% 120%, rgba(88, 28, 135, 0.28), transparent 65%),
    var(--bg);
  overflow: hidden;
}
body::before { /* faint circuit grid */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(167, 139, 250, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(167, 139, 250, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 40%, black 30%, transparent 85%);
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: rgba(217, 70, 239, 0.45); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(167, 139, 250, 0.22); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- top bar ---------- */
.topbar {
  position: relative; z-index: 5;
  height: 52px; display: flex; align-items: center; gap: 22px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(18, 7, 38, 0.9), rgba(10, 4, 22, 0.75));
  backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 0.16em; font-size: 13px; }
.brand .mark { width: 26px; height: 26px; filter: drop-shadow(0 0 8px rgba(217, 70, 239, 0.8)); }
.brand .tag { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; font-weight: 500; color: var(--hot);
  padding: 2px 7px; border: 1px solid rgba(217, 70, 239, 0.4); border-radius: 999px; background: rgba(217, 70, 239, 0.08); }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a {
  position: relative; text-decoration: none; color: var(--muted); padding: 7px 14px; border-radius: 9px; font-weight: 550; font-size: 13.5px;
  transition: color .15s, background .15s;
}
.nav a:hover { color: var(--text); background: rgba(167, 139, 250, 0.08); }
.nav a.active { color: var(--text); background: rgba(124, 58, 237, 0.18); }
.nav a.active::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: -9px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--electric), var(--neon)); box-shadow: 0 0 12px var(--neon);
}
.topbar .spacer { flex: 1; }
.status-pill { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11.5px; color: var(--muted);
  padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; background: rgba(12, 5, 26, 0.6); max-width: 420px; }
.status-pill span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.dot.busy { background: var(--neon); box-shadow: 0 0 8px var(--neon); animation: pulse 1s ease-in-out infinite; }
.dot.err { background: #ff5c8a; box-shadow: 0 0 8px #ff5c8a; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- shared controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line-2); background: rgba(30, 12, 62, 0.6); border-radius: 10px;
  padding: 7px 13px; font-weight: 600; font-size: 13px; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { background: rgba(60, 24, 120, 0.55); border-color: rgba(192, 132, 252, 0.55); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary {
  border-color: transparent; color: #fff;
  background: linear-gradient(135deg, #7c3aed, #c026d3);
  box-shadow: 0 0 0 1px rgba(245, 184, 255, 0.25) inset, 0 6px 22px rgba(168, 85, 247, 0.35);
}
.btn.primary:hover { box-shadow: 0 0 0 1px rgba(245, 184, 255, 0.45) inset, 0 6px 28px rgba(217, 70, 239, 0.55); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: rgba(167, 139, 250, 0.1); }
.btn.icon { padding: 7px; width: 34px; height: 34px; }

.field {
  background: rgba(10, 4, 24, 0.7); border: 1px solid var(--line-2); border-radius: 10px; padding: 7px 10px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field:focus { border-color: rgba(217, 70, 239, 0.7); box-shadow: 0 0 0 3px rgba(217, 70, 239, 0.15); }
select.field { padding-right: 26px; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 52%, calc(100% - 9px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }

.toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); cursor: pointer; user-select: none; }
.toggle input { display: none; }
.toggle .sw { width: 30px; height: 17px; border-radius: 999px; background: rgba(109, 97, 150, 0.35); position: relative; transition: background .15s; }
.toggle .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: #d8ccff; transition: transform .15s; }
.toggle input:checked + .sw { background: linear-gradient(90deg, var(--violet), var(--neon)); box-shadow: 0 0 10px rgba(217, 70, 239, .5); }
.toggle input:checked + .sw::after { transform: translateX(13px); background: #fff; }
.toggle input:checked ~ .lbl { color: var(--text); }

.kbd { font-family: var(--mono); font-size: 10.5px; padding: 1px 5px; border-radius: 5px; border: 1px solid var(--line-2); color: var(--muted); }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }

/* link back to the site embedding the lab (shown when the server sets GOOSE.home) */
.home-link { font-family: var(--mono); font-size: 11.5px; color: var(--muted); text-decoration: none; white-space: nowrap;
  padding: 5px 10px; border-radius: 999px; border: 1px solid transparent; transition: color .15s, border-color .15s; }
.home-link:hover { color: var(--text); border-color: var(--line-2); }
.offline-note { margin: 10px 0; padding: 10px 14px; border: 1px dashed rgba(217, 70, 239, .45); border-radius: 10px;
  background: rgba(40, 12, 70, .35); color: var(--muted); font-size: 13px; }
@media (max-width: 760px) { .home-link { display: none; } }
