:root {
  --bg: #020608;
  --panel: #040c10;

  --text: #d8f6ff;
  --muted: #7fcad8;

  --border: rgba(127, 202, 216, 0.35);
  --glow: rgba(127, 202, 216, 0.25);

  --danger: #ff5f56;
  --warn: #ffbd2e;
  --ok: #4fd3ff;
}

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

body {
  margin: 0;
  background:
    radial-gradient(900px 600px at 30% 10%, rgba(127,202,216,0.10), transparent 60%),
    radial-gradient(800px 500px at 70% 90%, rgba(127,202,216,0.08), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: ui-monospace, Menlo, Consolas, monospace;

  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px;
  overflow-y: auto;
}

.terminal {
  width: min(960px, 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.02), transparent 30%),
    var(--panel);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.45),
    0 30px 80px rgba(0,0,0,0.7);
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}

.lights { display: flex; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.red { background: var(--danger); }
.yellow { background: var(--warn); }
.green { background: var(--ok); }

.title {
  font-size: 13px;
  opacity: 0.85;
  letter-spacing: 0.25px;
}

.screen { padding: 18px; }

/* Terminal output buffer (capped + scrollable) */
.output {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 14px;
  background: rgba(0,0,0,0.55);
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,0.5),
    0 0 25px var(--glow);

  max-height: 180px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;

  scrollbar-width: thin; /* Firefox */
  scrollbar-color: rgba(127,202,216,0.55) rgba(0,0,0,0.25); /* Firefox */
}

/* WebKit scrollbar */
.output::-webkit-scrollbar { width: 8px; }
.output::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.25);
  border-left: 1px solid rgba(127,202,216,0.18);
}
.output::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(127,202,216,0.55), rgba(127,202,216,0.28));
  border-radius: 999px;
  border: 1px solid rgba(127,202,216,0.25);
}
.output::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(127,202,216,0.70), rgba(127,202,216,0.38));
}

.output p { margin: 0 0 8px; line-height: 1.45; }

.prompt { color: var(--text); }
.path { color: var(--muted); }
.muted { color: var(--muted); opacity: 0.85; }

fieldset {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  background: rgba(0,0,0,0.35);
}

legend {
  padding: 0 8px;
  color: var(--muted);
  letter-spacing: 0.4px;
}

.field {
  margin-bottom: 14px;
  display: grid;
  gap: 6px;
}

.label { font-size: 13px; }

input, textarea, select {
  background: rgba(0,0,0,0.6);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px;
  border-radius: 8px;
  outline: none;
}

textarea { resize: vertical; min-height: 90px; }

input:focus, textarea:focus, select:focus {
  border-color: rgba(127,202,216,0.8);
  box-shadow: 0 0 0 2px rgba(127,202,216,0.3);
}

.btn {
  background: rgba(127,202,216,0.12);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  cursor: pointer;
  border-radius: 8px;
}

.btn:hover { background: rgba(127,202,216,0.22); }
.btn.ghost { opacity: 0.85; }

.footer {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  background: rgba(255,255,255,0.02);
}

.hint {
  color: var(--muted);
  font-size: 13px;
  margin-top: 10px;
}

/* Multi-step pager */
.step { display: none; }
.step.active { display: block; }

.pager {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 12px;
}

.pager-mid {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0,0,0,0.35);
}

.progress-wrap {
  width: 100%;
  height: 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(0,0,0,0.35);
  overflow: hidden;
  margin: 10px 0 14px;
}

.progress-bar {
  height: 100%;
  background: rgba(127,202,216,0.35);
  width: 0%;
  transition: width 200ms ease;
}

/* Severity log styling */
.logline {
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.badge {
  flex: 0 0 auto;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.35);
  letter-spacing: 0.5px;
}

.log-msg { flex: 1 1 auto; opacity: 0.95; }

.badge.info {
  color: var(--muted);
  border-color: rgba(127,202,216,0.45);
  background: rgba(127,202,216,0.10);
}

.badge.warn {
  color: #ffd37a;
  border-color: rgba(255,189,46,0.55);
  background: rgba(255,189,46,0.10);
}

.badge.error {
  color: #ff9a9a;
  border-color: rgba(255,95,86,0.60);
  background: rgba(255,95,86,0.10);
}

/* Boot screen */
.boot-screen {
  position: fixed;
  inset: 0;
  background: #000;
  color: #7fcad8;
  padding: 24px;
  font-family: ui-monospace, monospace;
  z-index: 9999;
}

.fade-out { opacity: 0; transition: opacity 0.6s ease; }
.hidden { display: none; }




/* Application hub */
.hub { margin-top: 14px; }
.hub-top {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 12px;
  margin-bottom: 14px;
}
@media (max-width: 720px) { .hub-top { grid-template-columns: 1fr; } }

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 820px) { .grid { grid-template-columns: 1fr; } }

.card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: rgba(0,0,0,0.35);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.35);
}

.card-title { margin: 0 0 6px; font-size: 15px; letter-spacing: 0.2px; }
.card-desc { margin: 0 0 12px; }

.card-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid rgba(127,202,216,0.35);
  background: rgba(127,202,216,0.08);
  color: var(--muted);
  font-size: 12px;
}

.card-actions { display: flex; gap: 10px; align-items: center; padding-top: 20px; margin-top: 20px;}

.btn.disabled, a.disabled { pointer-events: none; opacity: 0.55; }

.link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed rgba(127,202,216,0.55);
}
.link:hover { border-bottom-style: solid; }