@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500&family=Inter:wght@400;500;600;700&display=swap');
:root {
  --bg: #000;
  --bg2: #0a0a0a;
  --card: #0a0a0a;
  --border: #262626;
  --text: #ededed;
  --muted: #8c8c8c;
  --accent: #fff;
  --accent2: #a3a3a3;
  --green: #46a758;
  --yellow: #e5a84b;
  --red: #e5484d;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; color-scheme: dark; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 Geist, Inter, ui-sans-serif, system-ui, sans-serif;
}
a { color: var(--text); text-decoration: none; }
a:hover { text-decoration: underline; }
button {
  font: inherit; cursor: pointer; border: none; border-radius: 8px;
  padding: 9px 14px; background: var(--accent); color: #000; font-weight: 500;
  transition: background .15s ease;
}
button:hover { background: #e5e5e5; }
button.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
button.ghost:hover { background: #111; }
button.danger { background: transparent; border: 1px solid var(--red); color: var(--red); }
button:disabled { opacity: .45; cursor: not-allowed; }
input, textarea, select {
  width: 100%; font: inherit; color: var(--text);
  background: transparent; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; outline: none; resize: vertical;
}
input:focus, textarea:focus, select:focus { border-color: #525252; }

.nav {
  display: flex; align-items: center; gap: 18px;
  max-width: 1200px; margin: 0 auto; padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 600; font-size: 14px; letter-spacing: -.2px; }
.brand span { color: var(--muted); }
.nav .spacer { flex: 1; }
.nav a.plain { color: var(--muted); text-decoration: none; }
.nav a.plain:hover { color: var(--text); text-decoration: none; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px 60px; }
.hero { text-align: left; padding: 80px 0 40px; }
.hero h1 { font-size: 48px; line-height: 1.1; letter-spacing: -1.6px; font-weight: 600; }
.hero h1 em { font-style: normal; color: var(--text); }
.hero p { color: var(--muted); margin: 16px 0 28px; max-width: 560px; font-size: 16px; }
.hero .cta { display: flex; gap: 12px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-top: 30px; }
.card {
  background: var(--card);
  border: 1px solid var(--border); border-radius: 8px; padding: 22px;
}
.card.featured { border-color: #fff; }
.card h3 { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; }
.price { font-size: 26px; font-weight: 600; letter-spacing: -0.5px; }
.price small { color: var(--muted); font-weight: 400; font-size: 13px; }
ul.specs { list-style: none; margin: 14px 0 18px; color: var(--muted); }
ul.specs li { padding: 3px 0; }
ul.specs li b { color: var(--text); font-weight: 500; }

.auth-card { max-width: 420px; margin: 80px auto; }
.auth-card form { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--red); font-size: 14px; min-height: 20px; }

.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 500; letter-spacing: 0; color: var(--muted); border: 1px solid var(--border); }
.badge.RUNNING, .badge.LIVE { color: var(--green); border-color: transparent; }
.badge.PENDING, .badge.PROVISIONING, .badge.DEPLOYING { color: var(--yellow); border-color: transparent; }
.badge.SUSPENDED, .badge.FAILED, .badge.DESTROYING, .badge.DESTROYED { color: var(--red); border-color: transparent; }
.tier-chip { background: var(--bg2); border: 1px solid var(--border); color: var(--muted); }

.bar { height: 4px; border-radius: 99px; background: #171717; overflow: hidden; }
.bar > i { display: block; height: 100%; background: #fff; }
.metric { margin: 8px 0; }
.metric .lbl { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 4px; }

.topbar-actions { display: flex; gap: 10px; align-items: center; }
.instance-row {
  display: flex; align-items: center; gap: 16px; padding: 16px 18px; cursor: pointer;
}
.instance-row:hover { background: #111; }
.instance-row .meta { flex: 1; }
.instance-row .meta .name { font-weight: 500; font-family: "Geist Mono", ui-monospace, monospace; font-size: 13px; }

.tabs { display: flex; gap: 18px; margin: 22px 0 0; border-bottom: 1px solid var(--border); }
.tab {
  padding: 10px 0; border-radius: 0; color: var(--muted); cursor: pointer; font-weight: 500; font-size: 14px;
}
.tab.active { color: var(--text); background: transparent; border: 0; border-bottom: 1px solid #fff; }
#terminal { height: 480px; padding: 6px; background: #000; border-radius: 8px; border: 1px solid var(--border); }
.kv { display: grid; grid-template-columns: 180px 1fr; row-gap: 10px; margin-top: 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { font-family: "Geist Mono", ui-monospace, monospace; user-select: all; word-break: break-all; }
.actions { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.modal-back {
  position: fixed; inset: 0; background: rgba(0,0,0,.7); display: flex;
  align-items: center; justify-content: center; padding: 20px; z-index: 50;
}
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--card); border: 1px solid var(--border); padding: 10px 18px;
  border-radius: 8px; z-index: 99;
}
.section-title { margin-top: 46px; font-size: 20px; font-weight: 600; letter-spacing: -0.4px; }
.empty {
  text-align: center; padding: 60px 20px; border: 1px dashed var(--border);
  border-radius: 8px; color: var(--muted); margin-top: 24px;
}

.grid.stats { margin-top: 24px; }
.card.stat { display: flex; flex-direction: column; gap: 6px; }
.card.stat strong { font-size: 26px; font-weight: 600; }
.grid.charts { grid-template-columns: 1fr 1fr; }
.card h3 a { color: var(--text); }
.table { width: 100%; border-collapse: collapse; margin-top: 14px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.table th { color: var(--muted); font-weight: 500; font-size: 12px; }
.table tbody tr:hover { background: #111; }
@media (max-width: 760px) { .grid.charts { grid-template-columns: 1fr; } }

.portal-wrap { padding-top: 32px; }
.portal-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; padding: 12px 0 32px; border-bottom: 1px solid var(--border); }
.eyebrow { display: block; color: var(--muted); font-size: 11px; line-height: 1; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.portal-hero h1 { margin-top: 10px; font-size: clamp(28px, 4vw, 36px); line-height: 1.1; letter-spacing: -1px; font-weight: 600; }
.portal-hero p { max-width: 585px; margin-top: 12px; color: var(--muted); }
.portal-hero-actions { display: flex; gap: 10px; flex: none; }
.overview-strip { display: grid; grid-template-columns: repeat(3, 1fr); margin: 28px 0 48px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.overview-strip div { min-height: 76px; padding: 14px 22px; display: flex; flex-direction: column; justify-content: center; border-right: 1px solid var(--border); background: var(--card); }
.overview-strip div:last-child { border: 0; }
.overview-strip span { color: var(--muted); font-size: 12px; }
.overview-strip b { font-size: 24px; letter-spacing: -1px; font-weight: 600; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 16px; }
.section-heading h2 { margin-top: 8px; letter-spacing: -0.5px; font-size: 18px; font-weight: 600; }
.instances-heading { margin-top: 48px; }
.text-button { padding: 0; background: transparent; color: var(--muted); font-size: 13px; }
.text-button:hover { background: transparent; color: var(--text); }
.text-button span { font-size: 17px; margin-left: 3px; }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.project-card { min-height: 132px; position: relative; display: flex; gap: 14px; align-items: flex-start; padding: 18px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); }
.project-card:hover { border-color: #404040; }
.project-mark { width: 32px; height: 32px; border-radius: 6px; display: grid; place-items: center; flex: none; background: #fff; color: #000; font-size: 13px; font-weight: 600; }
.project-main { min-width: 0; flex: 1; }
.project-title { display: flex; align-items: center; gap: 8px; }
.project-title h3 { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-main p { margin-top: 6px; color: var(--muted); font: 12px/1.4 "Geist Mono", ui-monospace, monospace; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.project-main small { display: block; margin-top: 9px; color: var(--muted); font-size: 11px; }
.branch { margin-left: 5px; color: var(--muted); }
.project-open { padding: 6px 10px; font-size: 12px; }
.project-empty { padding: 26px; min-height: 124px; display: flex; align-items: center; gap: 16px; border: 1px dashed var(--border); border-radius: 8px; }
.project-empty-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 8px; background: #111; color: var(--muted); font-size: 22px; }
.project-empty h3 { font-size: 15px; }
.project-empty p { color: var(--muted); font-size: 13px; margin-top: 3px; }
.project-empty button { margin-left: auto; flex: none; }
.instance-list { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.instance-row { display: flex; align-items: center; min-height: 64px; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text); }
.instance-row:last-child { border: 0; }
.instance-symbol { color: var(--muted); font-size: 16px; }
.instance-project-count { color: var(--muted); font-size: 12px; }
.row-arrow { color: var(--muted); font-size: 16px; }
.instance-empty { border: 1px dashed var(--border); border-radius: 8px; padding: 28px; display: flex; justify-content: space-between; align-items: center; color: var(--muted); }
.project-modal { width: min(100%, 530px); position: relative; }
.project-modal h2 { margin: 10px 0 6px; letter-spacing: -0.4px; font-weight: 600; }
.project-modal form { display: flex; flex-direction: column; gap: 13px; margin-top: 22px; }
.project-modal label { display: block; color: var(--muted); font-size: 12px; font-weight: 500; }
.project-modal input, .project-modal select { width: 100%; display: block; margin-top: 6px; }
.form-split { display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; }
.project-modal details { padding: 12px; border: 1px solid var(--border); border-radius: 8px; }
.project-modal details summary { color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 500; }
.project-modal details label { margin-top: 10px; }
.modal-close { position: absolute; right: 13px; top: 13px; padding: 1px 8px 4px; background: transparent; color: var(--muted); font-size: 22px; }
.modal-close:hover { background: transparent; color: white; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; align-items: center; margin-top: 6px; }
.terminal-link { padding: 9px 13px; border-radius: 8px; background: #fff; color: #000; font-weight: 500; font-size: 13px; }
.command-box { display: flex; align-items: center; gap: 8px; margin-top: 20px; padding: 11px; border: 1px solid var(--border); border-radius: 8px; background: #0a0a0a; }
.command-box code { flex: 1; color: var(--text); font: 12px/1.45 "Geist Mono", ui-monospace, monospace; overflow-wrap: anywhere; }
.command-box button { padding: 6px 10px; font-size: 12px; }
.command-note { margin-top: 12px; color: var(--muted); font-size: 13px; }
.command-note code { color: var(--text); }
.terminal-shell { overflow: hidden; border: 1px solid var(--border); border-radius: 8px; background: #000; }
.terminal-shell #terminal { height: 480px; border: 0; border-radius: 0; }
.terminal-toolbar { height: 44px; display: flex; align-items: center; justify-content: space-between; padding: 0 15px; background: #0a0a0a; border-bottom: 1px solid var(--border); font-size: 12px; }
.terminal-toolbar > div { display: flex; gap: 10px; align-items: center; }
.terminal-toolbar b { font-size: 12px; }
.terminal-dots { display: flex; gap: 5px; }
.terminal-dots i { display: block; width: 8px; height: 8px; border-radius: 50%; background: #525252; }
.terminal-live { color: var(--muted); font: 10px "Geist Mono", ui-monospace, monospace; letter-spacing: .06em; }
.row { display: flex; align-items: center; gap: 12px; }
.row.spread { justify-content: space-between; }
.plan-pick { transition: background .15s ease, border-color .15s ease; }
.plan-pick:hover { background: #111; border-color: #404040; }

@media (max-width: 760px) {
  .nav { padding: 14px 18px; gap: 10px; }
  .nav .topbar-actions .muted { display: none; }
  .wrap { padding: 0 18px 50px; }
  .hero { padding: 48px 0 32px; }
  .hero h1 { font-size: 32px; }
  .hero .cta { flex-wrap: wrap; }
  .card { padding: 18px; }
  .kv { grid-template-columns: 1fr; }
  .table { min-width: 630px; }
  .card:has(.table) { overflow-x: auto; }
  .portal-wrap { padding-top: 20px; }
  .portal-hero { align-items: flex-start; flex-direction: column; }
  .portal-hero-actions { width: 100%; }
  .portal-hero-actions button { flex: 1; }
  .project-grid { grid-template-columns: 1fr; }
  .project-empty { align-items: flex-start; flex-wrap: wrap; }
  .project-empty button { margin-left: 58px; }
  .instance-project-count { display: none; }
  .form-split { grid-template-columns: 1fr; }
}
@media (max-width: 430px) {
  .topbar-actions .plain { display: none; }
  .hero .cta { flex-direction: column; }
  .hero .cta button { width: 100%; }
}
