:root {
  --accent: #a5a9ff;
  --accent-strong: #8a8fe3;
  --accent-soft: #1c2233;
  --bg: #0f131c;
  --card: #161c27;
  --text: #e6edf7;
  --muted: #a1acc2;
  --border: #293347;
  --ghost: #1d2432;
  --ghost-strong: #252e3f;
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 20px;
}

main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

header {
  background: var(--card);
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

header h1 {
  margin: 6px 0;
  font-size: 2.4rem;
}

header .lede {
  color: var(--muted);
  margin: 0;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.8rem;
  color: var(--accent);
  margin: 0;
}

.card {
  background: var(--card);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.info-card {
  border-left: 4px solid var(--accent);
}

.card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.card-header h2 {
  margin: 2px 0 4px;
}

.card-header .meta {
  margin: 0;
}

label {
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
}

.primary-link {
  background: var(--accent);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
}

.primary-link:hover {
  background: var(--accent-strong);
}

.guide-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.guide-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--ghost);
  color: var(--accent);
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-weight: 700;
  text-decoration: none;
}

.guide-link:hover {
  background: var(--ghost-strong);
  color: #ffffff;
}

.input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.defaults-panel {
  display: grid;
  gap: 16px;
  margin: 12px 0 8px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--ghost);
}

.defaults-panel h3 {
  margin: 6px 0;
}

.defaults-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.defaults-status {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.defaults-status li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  font-weight: 600;
}

.status-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.status-badge.ready {
  background: rgba(122, 91, 210, 0.18);
  color: var(--accent);
  border: 1px solid rgba(122, 91, 210, 0.3);
}

.status-badge.applied {
  background: rgba(46, 204, 113, 0.16);
  color: #b9f5ce;
  border: 1px solid rgba(46, 204, 113, 0.3);
}

.status-badge.missing {
  background: rgba(231, 111, 81, 0.12);
  color: #ffb8a7;
  border: 1px solid rgba(231, 111, 81, 0.3);
}

.auto-sync-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.checkbox-row span {
  color: var(--text);
}

input[type="password"],
textarea,
select {
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 10px 12px;
  font-size: 1rem;
  font-family: 'Poppins', sans-serif;
  width: 100%;
  box-sizing: border-box;
  color: var(--text);
  background: var(--ghost);
}

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

button {
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
}

button.primary {
  background: var(--accent);
  color: #ffffff;
}

button.primary:hover {
  background: var(--accent-strong);
}

button.ghost {
  background: var(--ghost);
  color: var(--text);
}

button.ghost:hover {
  background: var(--ghost-strong);
}

.select-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.output {
  min-height: 120px;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  color: var(--text);
  white-space: pre-wrap;
}

.status {
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text);
}

.status.success {
  border-color: #2ecc71;
}

.status.error {
  border-color: #e76f51;
}

.status-note {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

#history {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#history li {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--ghost);
}

#history .meta {
  color: var(--muted);
  margin-top: 6px;
  font-size: 0.9rem;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

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

.github-create {
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--ghost);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.github-create-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.pill-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--ghost);
  cursor: pointer;
  font-weight: 600;
}

.pill input {
  margin: 0;
}

iframe {
  width: 100%;
  min-height: 300px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
}

.meta {
  color: var(--muted);
  margin-top: 4px;
}

#deployments,
#github-history {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#deployments li,
#github-history li {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--ghost);
}

#deployments a,
#github-history a {
  color: var(--accent);
  font-weight: 700;
}

#deployments .meta-row,
#github-history .meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
  color: var(--muted);
}

@media (min-width: 960px) {
  .grid {
    grid-template-columns: 1fr 1fr;
  }

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

  .defaults-panel {
    grid-template-columns: 1.1fr 1fr;
    align-items: start;
  }
}

@media (max-width: 720px) {
  body {
    padding: 16px;
  }

  header h1 {
    font-size: 2rem;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .card-header .primary-link {
    width: 100%;
    text-align: center;
  }

  .select-group {
    width: 100%;
    justify-content: space-between;
  }

  .input-row {
    flex-direction: column;
    align-items: stretch;
  }

  .input-row button {
    width: 100%;
  }

  .github-create-header {
    flex-direction: column;
    align-items: flex-start;
  }

  iframe {
    min-height: 240px;
  }
}
