/* Luna — theme copied from LunaConnect "Petrol Deck" dark tokens */
.dark {
  --background:     215 38% 6%;
  --foreground:     215 22% 94%;
  --card:           215 38% 9%;
  --card-2:         215 32% 11%;
  --muted:          215 28% 14%;
  --muted-fg:       215 15% 62%;
  --border:         215 28% 18%;
  --border-strong:  215 28% 28%;
  --primary:        187 78% 48%;
  --primary-fg:     215 38% 6%;
  --primary-soft:   187 50% 18%;
  --ring:           187 78% 50%;
  --success:        102 55% 46%;
  --destructive:    354 78% 51%;
  --warn:            41 100% 52%;
  --sidebar:        215 50% 4%;
  --radius:    8px;
  --radius-lg: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  height: 100vh;
  overflow: hidden;
}

/* ───────── Launcher ───────── */
.launcher {
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1100px 520px at 50% -8%, hsl(var(--primary) / 0.10), transparent 70%),
    hsl(var(--background));
}
.launcher[hidden] { display: none; }

.launcher__inner {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  flex: 1;
  padding: clamp(1.5rem, 5vh, 4rem) 1.25rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.welcome { display: flex; align-items: center; gap: 1rem; }
.welcome__logo {
  width: 60px; height: 60px; border-radius: 16px; flex: 0 0 auto;
  object-fit: cover; display: block;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
.welcome__text { min-width: 0; }
.welcome__title { margin: 0; font-size: 1.9rem; letter-spacing: -0.01em; }
.welcome__sub { margin: 0.2rem 0 0; color: hsl(var(--muted-fg)); }
.welcome__install {
  margin-left: auto; flex: 0 0 auto;
  padding: 0.45rem 0.95rem; font-size: 0.88rem;
}
.welcome__install[hidden] { display: none; }

/* ───────── Panels ───────── */
.panel { display: flex; flex-direction: column; gap: 0.5rem; }
.panel__heading {
  margin: 0 0 0.25rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: hsl(var(--muted-fg));
  font-weight: 600;
}

/* Start action (VS Code-style row) */
.start-item {
  display: flex; align-items: center; gap: 0.85rem;
  width: 100%; text-align: left;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  padding: 0.85rem 1rem;
  color: inherit; cursor: pointer;
  transition: border-color .15s, background .15s, transform .05s;
}
.start-item:hover { border-color: hsl(var(--primary) / 0.6); background: hsl(var(--card-2)); }
.start-item:active { transform: scale(0.995); }
.start-item__icon {
  width: 38px; height: 38px; flex: 0 0 auto; border-radius: 10px;
  display: grid; place-items: center; font-size: 1.4rem;
  background: hsl(var(--primary-soft)); color: hsl(var(--primary));
}
.start-item__text { display: flex; flex-direction: column; }
.start-item__title { font-weight: 600; }
.start-item__hint { font-size: 0.82rem; color: hsl(var(--muted-fg)); }

/* Add form */
.add-form {
  display: flex; flex-direction: column; gap: 0.6rem;
  background: hsl(var(--card)); border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg); padding: 1rem;
}
.add-form[hidden] { display: none; }
.add-form__actions { display: flex; gap: 0.5rem; }

.field {
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem; font-size: 0.95rem; outline: none;
}
.field:focus { border-color: hsl(var(--ring)); box-shadow: 0 0 0 3px hsl(var(--ring) / 0.18); }
.field::placeholder { color: hsl(var(--muted-fg)); }

/* ───────── Buttons ───────── */
.btn {
  background: hsl(var(--primary)); color: hsl(var(--primary-fg));
  border: none; border-radius: var(--radius);
  padding: 0.55rem 1.1rem; font-size: 0.92rem; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: filter .15s, transform .05s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(0.97); }
.btn--ghost {
  background: hsl(var(--muted)); color: hsl(var(--foreground));
}
.btn--ghost:hover { background: hsl(var(--border-strong)); }

/* ───────── Recent / connections list ───────── */
.recent { display: flex; flex-direction: column; gap: 0.4rem; }
.recent__empty { color: hsl(var(--muted-fg)); font-size: 0.88rem; font-style: italic; margin: 0.2rem 0 0; }
.recent__empty[hidden] { display: none; }

.conn {
  display: flex; align-items: center; gap: 0.8rem;
  background: hsl(var(--card)); border: 1px solid hsl(var(--border));
  border-radius: var(--radius); padding: 0.7rem 0.85rem;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.conn:hover { border-color: hsl(var(--primary) / 0.6); background: hsl(var(--card-2)); }
.conn__dot {
  width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto;
  background: hsl(var(--muted-fg));
}
.conn__dot--ok { background: hsl(var(--success)); box-shadow: 0 0 7px hsl(var(--success) / 0.8); }
.conn__dot--off { background: hsl(var(--destructive)); }
.conn__dot--checking { background: hsl(var(--warn)); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }

.conn__body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.conn__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conn__url  { font-size: 0.8rem; color: hsl(var(--muted-fg)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.conn__x {
  border: none; background: transparent; color: hsl(var(--muted-fg));
  cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 0.25rem 0.45rem; border-radius: 6px;
  flex: 0 0 auto;
}
.conn__x:hover { color: hsl(var(--destructive)); background: hsl(var(--destructive) / 0.14); }

.launcher__foot {
  text-align: center; color: hsl(var(--muted-fg));
  font-size: 0.78rem; padding: 1rem 0 1.5rem;
}

/* ───────── Viewer (full-screen iframe) ───────── */
.viewer { position: fixed; inset: 0; background: hsl(var(--background)); }
.viewer[hidden] { display: none; }
.frame { width: 100%; height: 100%; border: 0; display: block; background: #fff; }

.back {
  position: fixed; left: 0.6rem; bottom: 0.6rem; z-index: 10;
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid hsl(var(--border-strong));
  background: hsl(var(--sidebar) / 0.92); color: hsl(var(--foreground));
  font-size: 1.5rem; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
  box-shadow: 0 6px 18px rgba(0,0,0,0.5);
  transition: background .15s, border-color .15s;
}
.back:hover { background: hsl(var(--primary)); color: hsl(var(--primary-fg)); border-color: hsl(var(--primary)); }

