:root {
  --bg: #07110d;
  --bg-soft: #0d1b15;
  --panel: rgba(17, 31, 24, 0.92);
  --panel-strong: rgba(22, 42, 32, 0.98);
  --border: rgba(177, 255, 213, 0.16);
  --text: #f3fff7;
  --muted: #a8c2b3;
  --muted-2: #71907f;
  --accent: #55f5a3;
  --accent-2: #82ffd0;
  --danger: #ff7373;
  --warning: #ffd166;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(85, 245, 163, 0.16), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(130, 255, 208, 0.08), transparent 26rem),
    var(--bg);
  color: var(--text);
}

body {
  min-height: 100vh;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 34px 0;
}

.hidden {
  display: none !important;
}

.login-card {
  width: min(440px, 100%);
  margin: 12vh auto 0;
  padding: 34px;
  background: linear-gradient(145deg, rgba(18, 38, 29, 0.98), rgba(7, 17, 13, 0.94));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.brand-mark {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: rgba(85, 245, 163, 0.12);
  border: 1px solid rgba(85, 245, 163, 0.22);
  font-size: 38px;
  margin-bottom: 18px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  letter-spacing: -0.04em;
}

h2 {
  margin-bottom: 0;
  letter-spacing: -0.03em;
}

.muted,
.empty-state,
.status-strip small {
  color: var(--muted);
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
}

.status-strip {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(85, 245, 163, 0.07);
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(85, 245, 163, 0.82);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 18px;
  align-items: start;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.card-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}

.form-stack {
  display: grid;
  gap: 12px;
}

label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  color: var(--text);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(177, 255, 213, 0.18);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

textarea {
  resize: vertical;
  min-height: 118px;
  line-height: 1.45;
}

input:focus,
textarea:focus {
  border-color: rgba(85, 245, 163, 0.72);
  box-shadow: 0 0 0 4px rgba(85, 245, 163, 0.1);
  background: rgba(0, 0, 0, 0.28);
}

.save-toggle {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px dashed rgba(177, 255, 213, 0.2);
  border-radius: var(--radius-sm);
  background: rgba(85, 245, 163, 0.045);
}

.save-toggle input {
  width: auto;
  transform: scale(1.2);
}

.button-row,
.saved-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

button {
  border: 0;
  border-radius: var(--radius-sm);
  font-weight: 850;
  transition: transform 140ms ease, opacity 140ms ease, background 140ms ease, border-color 140ms ease;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

button:not(:disabled):active {
  transform: translateY(1px);
}

.primary,
.secondary,
.ghost {
  padding: 12px 16px;
}

.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #04130b;
  box-shadow: 0 16px 40px rgba(85, 245, 163, 0.16);
}

.secondary {
  color: var(--text);
  background: rgba(130, 255, 208, 0.12);
  border: 1px solid rgba(130, 255, 208, 0.18);
}

.ghost {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.small {
  padding: 9px 11px;
  font-size: 13px;
}

.full-width {
  width: 100%;
}

.saved-grid {
  display: grid;
  gap: 12px;
}

.saved-command {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(177, 255, 213, 0.14);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.16);
}

.saved-run {
  display: grid;
  width: 100%;
  gap: 6px;
  padding: 14px;
  text-align: left;
  color: var(--text);
  background: linear-gradient(135deg, rgba(85, 245, 163, 0.12), rgba(130, 255, 208, 0.06));
  border: 1px solid rgba(85, 245, 163, 0.18);
}

.saved-name {
  font-size: 16px;
}

.saved-command-text {
  color: var(--muted);
  overflow-wrap: anywhere;
  font-weight: 600;
}

.saved-actions button {
  padding: 8px 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
}

.delete-command {
  color: var(--danger) !important;
}

.console-card {
  margin-top: 18px;
}

.console-output {
  min-height: 200px;
  max-height: 420px;
  overflow: auto;
  padding: 16px;
  border-radius: var(--radius-md);
  background: #020705;
  border: 1px solid rgba(177, 255, 213, 0.12);
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.console-line {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.console-line:last-child {
  border-bottom: 0;
}

.console-ok {
  color: var(--accent);
}

.console-error {
  color: var(--danger);
}

.console-meta {
  color: var(--muted-2);
}

.error-message {
  margin: 12px 0 0;
  color: var(--danger);
  min-height: 20px;
}

.empty-state {
  padding: 18px;
  border: 1px dashed rgba(177, 255, 213, 0.16);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.12);
}

@media (max-width: 860px) {
  .shell {
    width: min(100% - 22px, 680px);
    padding: 18px 0;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .topbar,
  .status-strip {
    align-items: stretch;
    flex-direction: column;
    border-radius: var(--radius-md);
  }

  .card,
  .login-card {
    padding: 18px;
    border-radius: 22px;
  }
}
