:root {
  --bg: #f3efe4;
  --paper: rgba(255, 252, 245, 0.88);
  --ink: #14110f;
  --muted: #5e5a56;
  --line: rgba(20, 17, 15, 0.12);
  --accent: #0057ff;
  --accent-2: #ff5c2b;
  --accent-3: #0d8f59;
  --shadow: 10px 10px 0 #14110f;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 92, 43, 0.16), transparent 28%),
    radial-gradient(circle at 80% 12%, rgba(0, 87, 255, 0.14), transparent 24%),
    linear-gradient(135deg, #efe9db, #f7f4ea 42%, #ece6d8);
}

body:has(.admin-shell) {
  color: #edf3f8;
  background:
    radial-gradient(circle at top left, rgba(0, 87, 255, 0.1), transparent 24%),
    radial-gradient(circle at 80% 12%, rgba(13, 143, 89, 0.12), transparent 22%),
    linear-gradient(180deg, #0b1016, #111922 46%, #17222d);
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: 0.45;
}

.admin-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.28;
}

.shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 4rem;
  position: relative;
}

.admin-shell {
  padding-top: 2rem;
}

.admin-title {
  font-size: clamp(2.8rem, 7vw, 5rem);
  color: #edf3f8;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 0.8rem;
}

.admin-refresh-status {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #9eb0c1;
}

.admin-card {
  padding: 1rem;
}

.billing-return-banner {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.billing-return-banner strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.billing-return-banner p {
  margin: 0;
}

.billing-return-actions {
  margin-top: 0.8rem;
}

.billing-return-banner.is-success {
  border-color: rgba(74, 222, 128, 0.35);
  background: rgba(28, 74, 44, 0.38);
}

.billing-return-banner.is-warning {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(92, 58, 12, 0.34);
}

.billing-return-banner.is-danger {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(94, 34, 34, 0.34);
}

.admin-shell .section-copy,
.admin-shell .host-card p,
.admin-shell .admin-deployment-row span {
  color: #a6b5c3;
}

.admin-shell .hero-copy,
.admin-shell .hero-panel,
.admin-shell .host-card,
.admin-shell .agent-card,
.admin-shell .installer-grid article,
.admin-shell .admin-card,
.admin-shell .admin-deployment-row {
  background: rgba(16, 24, 33, 0.88);
  border-color: #365169;
  box-shadow: 14px 14px 0 rgba(5, 10, 15, 0.72);
}

.admin-shell .card-tag,
.admin-shell .badge {
  background: rgba(255, 255, 255, 0.08);
  border-color: #6c92b3;
  color: #edf3f8;
}

.admin-shell .cta,
.admin-shell .admin-action {
  border-color: #6c92b3;
  background: #16222d;
  color: #edf3f8;
}

.admin-shell .primary {
  background: #0f5dff;
}

.admin-hero {
  padding: 1.2rem 1.4rem 0;
}

.admin-kicker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.admin-back-link {
  color: #9ed9ff;
  font-weight: 700;
}

.admin-logs {
  margin-top: 1rem;
}

.admin-logs-output {
  white-space: pre-wrap;
  word-break: break-word;
  background: #14110f;
  color: #fff;
  padding: 1rem;
  min-height: 220px;
  border: 2px solid var(--ink);
}

.shell-output {
  min-height: 58vh;
  max-height: 70vh;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background:
    radial-gradient(circle at top left, rgba(255, 179, 71, 0.1), transparent 26%),
    linear-gradient(180deg, #0c1217, #0a0f14 55%, #0d141b);
  color: #c9f7d0;
  border: 2px solid #28323c;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.04),
    inset 0 24px 60px rgba(0,0,0,0.32);
  white-space: pre-wrap;
  word-break: break-word;
  padding: 0;
  cursor: text;
}

.terminal-card {
  overflow: hidden;
  padding: 0;
  background: #0f151b;
  border-color: #1f2830;
  box-shadow: 16px 16px 0 #14110f;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  justify-content: space-between;
  padding: 0.8rem 1rem 0.7rem;
  background: linear-gradient(180deg, #161d23, #12181e);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.terminal-chrome {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.terminal-dot {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 999px;
  background: #f2c14e;
  border: 1px solid rgba(0, 0, 0, 0.35);
}

.terminal-dot:first-child {
  background: #f25f5c;
}

.terminal-dot:nth-child(2) {
  background: #70c1b3;
}

.terminal-label {
  color: #f5f1e8;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92rem;
  flex: 1;
  opacity: 0.95;
  padding: 0 0.8rem;
}

.terminal-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.terminal-action {
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
  color: #f5f1e8;
  font: inherit;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.83rem;
  padding: 0.42rem 0.7rem;
  cursor: pointer;
}

.terminal-action:disabled {
  opacity: 0.45;
  cursor: default;
}

.terminal-action.danger {
  color: #ffb4a8;
  border-color: rgba(242,95,92,0.36);
}

.terminal-meta-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem 1rem;
  background: #172028;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.terminal-status,
.terminal-mode {
  color: #f5f1e8;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88rem;
}

.terminal-mode {
  color: #9ed9ff;
}

.shell-help {
  margin: 0;
  padding: 0.85rem 1rem 1rem;
  font-size: 0.92rem;
  color: #95a4b3;
  background: #11181e;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.shell-output .xterm {
  padding: 0.9rem 0.95rem;
}

.shell-output .xterm-viewport {
  overflow-y: auto !important;
}

.terminal-card:fullscreen {
  width: 100vw;
  height: 100vh;
  margin: 0;
  border: 0;
  box-shadow: none;
}

.terminal-card:fullscreen .shell-output {
  min-height: calc(100vh - 210px);
  max-height: calc(100vh - 210px);
}

@media (max-width: 720px) {
  .terminal-bar,
  .terminal-meta-row,
  .shell-form {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .terminal-bar {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .terminal-label {
    padding: 0;
  }

  .terminal-actions {
    flex-wrap: wrap;
  }

  .terminal-meta-row {
    grid-template-columns: 1fr;
  }
}

.admin-deployments-list {
  display: grid;
  gap: 0.8rem;
}

.admin-deployment-row {
  display: grid;
  gap: 0.25rem;
  padding: 0.8rem;
  border: 2px solid var(--ink);
  background: #fff;
}

.admin-row-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}

.admin-action {
  border: 2px solid var(--ink);
  background: #fff;
  padding: 0.45rem 0.7rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.hero,
.hosting,
.catalog,
.installer,
.sources {
  margin-top: 1.2rem;
}

.hero {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 1rem;
  align-items: stretch;
}

.hero-copy,
.hero-panel,
.host-card,
.agent-card,
.installer-grid article {
  background: var(--paper);
  backdrop-filter: blur(10px);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 1.4rem;
}

.hero-panel {
  padding: 1.2rem;
  align-self: start;
}

.eyebrow,
.panel-label,
.card-tag,
.badge {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.eyebrow,
.panel-label {
  font-size: 0.78rem;
  color: var(--accent);
  margin: 0 0 0.5rem;
}

h1,
h2,
h3 {
  margin: 0;
}

h1,
h2 {
  font-family: "Archivo Black", sans-serif;
  line-height: 0.95;
}

h1 {
  font-size: clamp(3.2rem, 8vw, 6.7rem);
  max-width: 9ch;
}

h2 {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

.lede,
.panel-copy,
.section-copy,
.host-card p,
.agent-card p,
.installer-grid p,
.host-points li {
  color: var(--muted);
}

.lede {
  max-width: 62ch;
  font-size: 1.05rem;
  margin-top: 1rem;
}

.panel-copy {
  margin-top: 0.85rem;
}

.hero-actions {
  display: flex;
  gap: 0.8rem;
  margin-top: 1.3rem;
  flex-wrap: wrap;
}

.site-nav {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-weight: 700;
}

.site-nav-links {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--ink);
}

.site-session {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
}

.site-logout {
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.contact-form {
  margin-top: 1.2rem;
  padding: 1rem;
  border: 2px solid var(--ink);
  background: rgba(255, 255, 255, 0.72);
}

.contact-label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.contact-row {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.contact-input {
  flex: 1 1 260px;
  min-width: 0;
  border: 2px solid var(--ink);
  padding: 0.8rem 0.9rem;
  font: inherit;
  background: #fffdf6;
}

.phone-status {
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.cta,
.install-button {
  appearance: none;
  border: 2px solid var(--ink);
  padding: 0.8rem 1rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

.cta:hover,
.install-button:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}

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

.ghost {
  background: #fff;
}

.host-points {
  margin: 1rem 0 0;
  padding-left: 1.2rem;
}

.section-head {
  margin-bottom: 1rem;
}

.hosting-grid,
.installer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.installer-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.host-card,
.installer-grid article {
  padding: 1rem;
}

.recommended {
  background:
    linear-gradient(135deg, rgba(0, 87, 255, 0.08), rgba(255, 255, 255, 0.9)),
    var(--paper);
}

.card-tag {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.18rem 0.5rem;
  border: 1px solid var(--ink);
  background: #fff;
  margin-bottom: 0.8rem;
}

.agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.agent-card {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  transform: translateY(20px);
  opacity: 0;
  animation: reveal 0.45s ease forwards;
}

.agent-card:nth-child(2) { animation-delay: 0.05s; }
.agent-card:nth-child(3) { animation-delay: 0.1s; }
.agent-card:nth-child(4) { animation-delay: 0.15s; }
.agent-card:nth-child(5) { animation-delay: 0.2s; }
.agent-card:nth-child(6) { animation-delay: 0.25s; }
.agent-card:nth-child(7) { animation-delay: 0.3s; }

.card-top,
.meta {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: center;
  flex-wrap: wrap;
}

.badge {
  font-size: 0.72rem;
  padding: 0.18rem 0.45rem;
  background: rgba(13, 143, 89, 0.1);
  border: 1px solid var(--accent-3);
  color: var(--accent-3);
}

.repo-link {
  color: var(--ink);
  font-weight: 700;
}

.fit {
  min-height: 4.5rem;
}

.meta {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: auto;
}

.deployment-status {
  margin: 0;
  min-height: 1.2rem;
  font-size: 0.92rem;
  color: var(--accent);
  font-weight: 700;
}

.deployment-meta {
  margin: 0;
  min-height: 1.2rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.deploy-config {
  display: grid;
  gap: 0.7rem;
  padding: 0.8rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.45);
}

.config-field {
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.config-field input[type="text"] {
  width: 100%;
  border: 1px solid var(--ink);
  background: #fffdf8;
  font: inherit;
  padding: 0.55rem 0.65rem;
}

.config-field textarea {
  width: 100%;
  border: 1px solid var(--ink);
  background: #fffdf8;
  font: inherit;
  padding: 0.55rem 0.65rem;
  resize: vertical;
  min-height: 7rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.config-field input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
}

.open-agent-link {
  display: inline-block;
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
}

.open-agent-link[hidden] {
  display: none;
}

.install-button {
  background: var(--accent-2);
  color: #fff;
}

.install-button[disabled] {
  cursor: wait;
  opacity: 0.75;
}

.billing-actions {
  display: grid;
  gap: 0.6rem;
}

.ghost-billing {
  background: #fff;
  color: var(--ink);
}

.source-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.8rem;
}

.source-list a {
  display: block;
  padding: 0.9rem 1rem;
  border: 2px solid var(--ink);
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  padding: 0.9rem 1rem;
  border: 2px solid #fff;
  background: var(--ink);
  color: #fff;
  z-index: 20;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

.profile-admin-panel {
  margin-top: 1.5rem;
}

.profile-deployment-row,
.profile-user-row,
.profile-plan-form {
  padding: 0.9rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.52);
}

.profile-deployment-row + .profile-deployment-row,
.profile-user-row + .profile-user-row,
.profile-plan-form + .profile-plan-form {
  margin-top: 0.8rem;
}

.profile-user-row {
  display: grid;
  gap: 0.8rem;
}

.profile-user-row-copy p,
.profile-deployment-row p,
.profile-plan-form h4,
.profile-user-row h4 {
  margin: 0.35rem 0 0;
}

@keyframes reveal {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 920px) {
  .hero,
  .hosting-grid,
  .installer-grid {
    grid-template-columns: 1fr;
  }

  .shell {
    width: min(100% - 1rem, 1180px);
  }
}

@media (max-width: 620px) {
  h1 {
    max-width: none;
    font-size: clamp(2.7rem, 14vw, 4.5rem);
  }

  .hero-copy,
  .hero-panel,
  .host-card,
  .agent-card,
  .installer-grid article {
    box-shadow: 6px 6px 0 var(--ink);
  }
}
