@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500;600&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg-page: #141517;
  --bg-surface: #17181a;
  --bg-elevated: #212325;
  --bg-pill: #26272b;
  --border: #3c3c3c;
  --text-primary: #f1f1f1;
  --text-muted: #a3a3a3;
  --purple: #9b63ff;
  --pink: #f040f5;
  --steel: #9b63ff;
  --steel-bright: #b88aff;
  --iron: #5c5c62;
  --green: #25e673;
  --red: #ff0050;
  --cta-fg: #17181a;
  --radius: 10px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  --header-h: 64px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100vw;
}

.mono { font-family: 'DM Mono', monospace; }

/* ── Header ── */
.site-header {
  display: flex;
  align-items: center;
  gap: 2rem;
  height: var(--header-h);
  padding: 0 1.5rem;
  background: rgba(20, 21, 23, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

.site-shell {
  position: relative;
  z-index: 1;
  padding-top: var(--header-h);
  min-height: calc(100vh - var(--header-h));
}

.logo-lockup {
  display: flex;
  align-items: center;
  gap: 0;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.logo-lockup .logo-img {
  display: block;
  height: 32px;
  width: auto;
}

.logo-lockup .wordmark {
  display: none;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-left: auto;
  flex-shrink: 0;
}

.header-badge {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 0.15rem;
  font-weight: 500;
}

.header-stamp {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.rate-pill {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-page);
}

.rate-pill strong { color: var(--text-primary); font-weight: 500; }

/* ── Fixed hero background ── */
.hero-bg,
.mascot-fixed {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero-bg img,
.mascot-fixed img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}

.hero-bg::after,
.mascot-fixed::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      62% 55% at 50% 30%,
      rgba(18, 18, 20, 0.55) 0%,
      rgba(18, 18, 20, 0.12) 48%,
      rgba(20, 21, 23, 0.3) 100%
    ),
    linear-gradient(
      180deg,
      rgba(20, 21, 23, 0.15) 0%,
      rgba(20, 21, 23, 0.32) 60%,
      rgba(20, 21, 23, 0.85) 100%
    );
  pointer-events: none;
}

.hero-bg.hidden,
.mascot-fixed.hidden {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s;
}

/* ── Hero ── */
.hero {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: clamp(380px, 60vh, 560px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    46% 58% at 50% 50%,
    rgba(18, 18, 20, 0.72) 0%,
    rgba(18, 18, 20, 0.28) 52%,
    transparent 100%
  );
  z-index: 0;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: clamp(1.5rem, 4vw, 3rem) 1.5rem;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
  text-align: center;
}

.hero-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--text-muted);
  margin: 0 0 0.85rem;
}

.hero h1 {
  font-family: 'DM Mono', monospace;
  font-size: clamp(2rem, 5vw, 2.8125rem);
  font-weight: 500;
  margin: 0 auto 1rem;
  max-width: 32rem;
  line-height: 1.28;
  color: #fff;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.55);
}

.hero-lead {
  color: var(--text-primary);
  margin: 0 auto 0.9rem;
  max-width: 30rem;
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.4;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5);
}

.hero-tagline {
  font-family: 'DM Mono', monospace;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: -0.01em;
  margin: 0 auto 1.75rem;
  max-width: 24rem;
  line-height: 1.4;
}

.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; justify-content: center; }

.hero.collapsed {
  min-height: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: max-height 0.4s ease, opacity 0.3s ease;
}

.hero.collapsed ~ .site-main {
  margin-top: 0;
}

.hero.collapsed ~ .site-main .catalog-overlap {
  border-radius: var(--radius);
}

/* ── Layout ── */
.site-main {
  position: relative;
  z-index: 5;
  max-width: 1120px;
  margin: -2.5rem auto 0;
  padding: 0 1.5rem 3rem;
}

.page-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.doc-page {
  max-width: 920px;
}

.catalog-overlap {
  padding-top: 0.5rem;
  background: transparent;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.section-head h2 {
  font-family: 'DM Mono', monospace;
  font-size: 1.375rem;
  font-weight: 500;
  margin: 0;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.6);
}

.section-head p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ── Catalog tabs ── */
.line-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.line-tab {
  font-family: 'DM Mono', monospace;
  font-size: 0.8125rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.line-tab:hover { border-color: var(--iron); color: var(--text-primary); }

.line-tab.active {
  border-color: var(--pink);
  background: rgba(240, 64, 245, 0.08);
  color: var(--pink);
}

/* ── Plan grid ── */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.plan-card {
  background: rgba(23, 24, 26, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 1.25rem;
  cursor: pointer;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s, background 0.18s;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.plan-card:hover {
  border-color: var(--purple);
  background: rgba(28, 29, 32, 0.9);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 0 24px rgba(155, 99, 255, 0.18);
  transform: translateY(-3px);
}

.plan-card.selected,
.plan-card.featured {
  border-color: var(--purple);
  background: rgba(28, 29, 32, 0.92);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--purple), 0 0 28px rgba(155, 99, 255, 0.2);
}

.plan-card .plan-badge {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--purple);
  margin: -0.25rem 0 0;
}

.plan-card .tier {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.plan-card h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.plan-card .plan-dc {
  margin: -0.35rem 0 0;
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.plan-card .specs {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.45;
  flex: 1;
}

.plan-prices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.price-chip {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  background: var(--bg-page);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.price-chip strong { color: var(--text-primary); }

.plan-card .from-price {
  font-family: 'DM Mono', monospace;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-primary);
}

.plan-card .from-price span {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
}

/* ── App views (My VMs, Wallet) — no hero, solid workspace ── */
body.mode-app .hero,
body.mode-app .hero-bg {
  display: none;
}

body.mode-app .site-shell {
  padding-top: var(--header-h);
}

body.mode-app .site-main {
  margin-top: 0;
  padding-top: 2rem;
}

.app-view {
  max-width: 1120px;
  margin: 0 auto;
}

.app-view .section-head h2 {
  font-size: 1.5rem;
}

/* ── Configure modal ── */
.modal-configure {
  display: flex;
  flex-direction: column;
  max-height: min(92vh, 820px);
  padding: 0;
  overflow: hidden;
  border-color: rgba(155, 99, 255, 0.35);
}

.modal-configure-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-configure-header h3 {
  margin: 0;
}

.modal-configure-header .modal-sub {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
}

.modal-close {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.modal-close:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.modal-configure-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  min-height: 0;
}

.modal-configure-footer {
  flex-shrink: 0;
  margin: 0;
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(155, 99, 255, 0.3);
  background: rgba(20, 21, 23, 0.98);
}

#order-modal {
  z-index: 215;
}

.modal-order {
  max-width: min(96vw, 520px);
  max-height: 92vh;
  overflow-y: auto;
}

.modal-order-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.modal-order-header h3 {
  margin: 0;
}

.order-pay-summary {
  text-align: center;
  margin: 1rem 0 1.25rem;
}

.pay-ndebit-section {
  margin: 1rem 0;
  padding: 1rem;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.pay-ndebit-section input {
  width: 100%;
  margin: 0.35rem 0 0.75rem;
}

#order-pay-step .btn {
  width: 100%;
  margin-top: 0.75rem;
}

#order-progress-step {
  margin-top: 0.5rem;
}

.order-progress-active {
  margin: 0 0 1rem;
  padding: 1rem 1.1rem;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}

.progress-spinner {
  width: 28px;
  height: 28px;
  margin: 0 auto 0.75rem;
  border: 3px solid var(--iron);
  border-top-color: var(--steel);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.order-progress-detail {
  margin: 0;
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.45;
}

.order-progress-countdown {
  margin: 0.5rem 0 0;
  font-family: 'DM Mono', monospace;
  font-size: 1.05rem;
  color: var(--steel);
}

.order-progress-elapsed {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

#order-error {
  margin-bottom: 1rem;
}

#configure-modal {
  z-index: 210;
}

#auth-modal {
  z-index: 220;
}

#confirm-modal {
  z-index: 230;
}

/* legacy inline panel — unused */
.configure-panel { display: none; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
}

.form-grid .full { grid-column: 1 / -1; }

label {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

input, select, textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9375rem;
  transition: border-color 0.15s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--steel);
}

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

.checkout-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  padding: 1.25rem 0 0;
  border-top: 1px solid rgba(155, 99, 255, 0.25);
  background: transparent;
  flex-wrap: wrap;
}

.modal-configure-footer.checkout-bar {
  margin-top: 0;
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(155, 99, 255, 0.3);
}

.quote-block .quote-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.quote-block .quote-amount {
  font-family: 'DM Mono', monospace;
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.quote-block .quote-sub {
  font-family: 'DM Mono', monospace;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.quote-hint {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  color: var(--pink);
}

/* ── Modal ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  padding: 1.75rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow);
}

.modal.modal-configure {
  max-width: min(96vw, 920px);
  padding: 0;
}

.modal h3 {
  font-family: 'DM Mono', monospace;
  margin: 0 0 0.35rem;
}

.modal .modal-sub {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin: 0 0 1.25rem;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.modal-actions .btn { flex: 1; }

/* ── Status ── */
.ladder { list-style: none; padding: 0; margin: 0; }

.ladder li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0;
  border-left: 3px solid var(--iron);
  padding-left: 0.85rem;
  margin-bottom: 0.25rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.ladder li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--iron);
  margin-left: -1.15rem;
  flex-shrink: 0;
}

.ladder li.active {
  border-color: var(--steel);
  color: var(--text-primary);
}

.ladder li.active::before { background: var(--steel); box-shadow: 0 0 8px var(--steel); }

.ladder li.done {
  border-color: var(--green);
  color: var(--green);
}

.ladder li.done::before { background: var(--green); }

.ladder li.failed {
  border-color: var(--red);
  color: var(--red);
}

.qr-wrap {
  background: var(--bg-page);
  border: 1px solid var(--purple);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  margin-top: 1.25rem;
}

.qr-wrap p { margin: 0.75rem 0 0; }

.payment-invoice {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.2);
}

.payment-invoice .pay-label {
  margin: 0 0 0.35rem;
  font-weight: 600;
}

.payment-invoice .field-hint {
  margin: 0 0 0.75rem;
}

.payment-invoice .qr-wrap {
  margin-top: 0;
}

.payment-invoice .bolt11 {
  margin: 0.75rem 0;
}

.payment-invoice .btn {
  margin-top: 0.25rem;
}

.bolt11 {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  word-break: break-all;
  color: var(--text-muted);
}

.vm-ready {
  margin-top: 1.25rem;
  padding: 1.25rem;
  background: rgba(37, 230, 115, 0.08);
  border: 1px solid rgba(37, 230, 115, 0.35);
  border-radius: var(--radius);
}

.vm-ready h4 {
  margin: 0 0 0.75rem;
  color: var(--green);
  font-family: 'DM Mono', monospace;
}

.vm-ready .detail {
  font-family: 'DM Mono', monospace;
  font-size: 0.8125rem;
  margin: 0.35rem 0;
  color: var(--text-primary);
}

/* ── Buttons ── */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 42px;
  padding: 0 1.25rem;
  border-radius: var(--radius);
  border: none;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  text-decoration: none;
  white-space: nowrap;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--text-primary);
  color: var(--cta-fg);
  font-weight: 500;
}

.btn-primary:hover { background: #fff; }

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-accent {
  background: var(--pink);
  color: var(--cta-fg);
  font-weight: 500;
}

.btn-accent:hover { background: #ff5cf7; }

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid rgba(241, 241, 241, 0.5);
  font-weight: 500;
}

.btn-secondary:hover { border-color: var(--text-primary); color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: none;
  height: auto;
  padding: 0.25rem;
  font-weight: 500;
}

.btn-ghost:hover { color: var(--text-primary); }

/* ── Footer ── */
.site-footer {
  position: relative;
  z-index: 5;
  text-align: center;
  padding: 2rem 1.5rem 2.5rem;
  margin-top: 2rem;
  color: var(--text-muted);
  font-size: 0.8125rem;
  border-top: 1px solid var(--border);
  background: var(--bg-page);
  box-shadow: 0 -24px 48px var(--bg-page);
}

.site-footer strong {
  color: var(--purple);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.hidden { display: none !important; }

.main-nav {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 1;
  min-width: 0;
}
.nav-tab {
  font-family: 'DM Mono', monospace;
  font-size: 0.875rem;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

a.nav-tab {
  display: inline-block;
  text-decoration: none;
}
.nav-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}
.nav-tab.active {
  color: var(--pink);
  background: var(--bg-pill);
  font-weight: 500;
}
.balance-pill {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-page);
  cursor: pointer;
}
.balance-pill:hover {
  border-color: var(--steel);
  color: var(--text-primary);
}
.balance-pill strong { color: var(--green); }
.user-menu {
  position: relative;
  flex-shrink: 0;
}
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 34px;
  max-width: 11rem;
  padding: 0 0.65rem 0 0.25rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-pill);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.user-chip:hover,
.user-chip[aria-expanded="true"] {
  border-color: var(--steel);
  background: var(--bg-elevated);
}
.user-chip .user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-page);
  flex-shrink: 0;
}
.user-chip .user-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.user-menu-panel {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  z-index: 120;
  min-width: 14.5rem;
  padding: 0.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
}
.user-menu-panel.hidden { display: none; }
.user-menu-head {
  padding: 0.55rem 0.65rem 0.7rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.35rem;
}
.user-menu-display {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-menu-npub {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-menu-npub:hover { color: var(--steel-bright); }
.user-menu-item {
  display: block;
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.user-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
}
.user-menu-sep {
  height: 1px;
  margin: 0.35rem 0.4rem;
  background: var(--border);
}
.user-menu-danger { color: var(--red); }
.user-menu-danger:hover { background: rgba(255, 0, 80, 0.1); }
.btn-sm { height: 34px; padding: 0 0.75rem; font-size: 0.8125rem; }
.card-surface { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); }
.alert-banner { padding: 0.85rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.875rem; }
.resume-order-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.resume-order-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.alert-error { background: rgba(255,0,80,0.12); border: 1px solid var(--red); color: var(--red); }
.alert-info { background: rgba(174,184,200,0.12); border: 1px solid var(--steel); color: var(--steel-bright); }
.field-error { color: var(--red); font-size: 0.8125rem; margin: 0.25rem 0 0; }
.field-hint { color: var(--text-muted); font-size: 0.8125rem; margin: 0.25rem 0 0; }
.field-warn { color: var(--red); }
.modal-notice {
  margin: 0 0 0.85rem;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius);
  font-size: 0.8125rem;
  line-height: 1.45;
}
.modal-notice.info { background: rgba(155, 99, 255, 0.12); border: 1px solid rgba(155, 99, 255, 0.4); color: var(--steel-bright); }
.modal-notice.error { background: rgba(255, 0, 80, 0.1); border: 1px solid var(--red); color: var(--red); }
.order-error { background: rgba(255,0,80,0.1); border: 1px solid var(--red); border-radius: var(--radius); padding: 0.85rem; color: var(--red); margin-bottom: 1rem; font-size: 0.875rem; }
.vm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.vm-card {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.vm-card h4 {
  margin: 0;
  font-family: 'DM Mono', monospace;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.vm-card .vm-status {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  flex-shrink: 0;
}
.vm-card .vm-status.ready { background: rgba(37, 230, 115, 0.15); color: var(--green); }
.vm-card .vm-status.pending { background: rgba(155, 99, 255, 0.15); color: var(--purple); }
.vm-card .vm-status.other { background: rgba(110, 118, 128, 0.15); color: var(--text-muted); }
.vm-card .ssh-line {
  font-family: 'DM Mono', monospace;
  font-size: 0.8125rem;
  color: var(--text-primary);
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.65rem;
  word-break: break-all;
}
.vm-card .detail { font-size: 0.8125rem; margin: 0; color: var(--text-muted); }
.vm-card .detail strong { color: var(--text-primary); font-weight: 500; }
.vm-card .vm-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.35rem 1rem;
  margin-top: 0.5rem;
}
.vm-card .connection-note {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0.35rem 0 0;
}
.vm-card .vm-password-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0 0;
}
.vm-card .vm-password,
#vm-box .vm-password {
  font-size: 0.875rem;
  padding: 0.35rem 0.5rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm, 6px);
  user-select: all;
}
.vm-card .vm-password.hidden,
.vm-card .vm-password-row .hidden,
#vm-box .hidden {
  display: none;
}
.vm-card .vm-details-expand {
  margin-top: 0.75rem;
  font-size: 0.75rem;
}
.vm-card .vm-details-expand summary {
  cursor: pointer;
  color: var(--text-muted);
  user-select: none;
}
.vm-card .vm-details-expand pre {
  margin: 0.5rem 0 0;
  padding: 0.65rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm, 6px);
  overflow-x: auto;
  max-height: 16rem;
  font-size: 0.65rem;
  line-height: 1.4;
}
.vm-card .vm-status.failed { background: rgba(255, 99, 99, 0.12); color: #ff8a8a; }

.orders-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 1.5rem 0 0.75rem;
  grid-column: 1 / -1;
}
.orders-section-title:first-child { margin-top: 0; }

.vm-card .order-action {
  margin-top: 0.75rem;
}

.vm-card-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'DM Mono', monospace;
}

.vm-card-name {
  font-size: 1rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
}

.vm-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.vm-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border-radius: var(--radius-sm, 6px);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.vm-icon-btn:hover {
  background: var(--surface-elevated, rgba(255, 255, 255, 0.06));
  color: var(--text-primary);
}

.vm-icon-btn.active {
  color: var(--text-primary);
  border-color: var(--accent, #9b63ff);
}

.vm-icon-danger:hover {
  color: #ff8a8a;
  border-color: rgba(255, 99, 99, 0.4);
  background: rgba(255, 99, 99, 0.12);
}

.vm-power-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.5rem;
}

.modal-vm {
  max-width: 32rem;
  width: 100%;
}

.modal-vm-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 0.5rem;
}

.vm-upgrade-pay {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.vm-manage {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.vm-setting {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.vm-setting-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.vm-setting-head h5 {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.vm-setting-danger {
  border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  padding-top: 1rem;
}

.vm-setting-danger h5 {
  color: #ff8a8a;
}

.vm-field-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.vm-reinstall-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.vm-resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
  gap: 0.5rem;
}

.vm-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.vm-field-label {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-muted);
}

.vm-resource-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.vm-ssh-row {
  align-items: stretch;
}

.vm-ssh-row .vm-ssh-input {
  flex: 1 1 12rem;
  min-width: 10rem;
}

.vm-os-select,
.vm-resource-select,
.vm-ssh-input {
  font-size: 0.8125rem;
  padding: 0.4375rem 0.625rem;
  border-radius: var(--radius-sm, 6px);
  border: 1px solid var(--border);
  background-color: var(--bg-elevated);
  color: var(--text-primary);
  color-scheme: dark;
  width: 100%;
}

.vm-os-select option,
.vm-resource-select option {
  background-color: var(--bg-elevated);
  color: var(--text-primary);
}

.vm-os-select {
  flex: 1 1 10rem;
  min-width: 8rem;
  width: auto;
}

.vm-action-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
}

.btn-danger {
  background: rgba(255, 99, 99, 0.15);
  color: #ff8a8a;
  border: 1px solid rgba(255, 99, 99, 0.35);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(255, 99, 99, 0.25);
}

.order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.nav-tab .nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.125rem;
  height: 1.125rem;
  padding: 0 0.25rem;
  margin-left: 0.35rem;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 700;
  background: var(--purple);
  color: #fff;
  vertical-align: middle;
}
.wallet-panel { padding: 1.5rem; }
.wallet-balance { font-size: 2rem; color: var(--green); }
.modal-divider { text-align: center; color: var(--text-muted); font-size: 0.8125rem; margin: 1rem 0; }
.nostr-ext-box { margin-bottom: 0.25rem; }
.nostr-ext-box .btn { width: 100%; }
.nostr-ext-box .field-hint { margin-top: 0.4rem; }
.auth-generate-btn { width: 100%; }
.modal-auth { max-width: min(96vw, 480px); }
.modal-confirm { max-width: min(94vw, 420px); }
.modal-confirm h3 { margin: 0 0 0.5rem; }
.modal-confirm .modal-sub { margin: 0 0 1.25rem; }
.modal-confirm .modal-actions { margin-top: 0; }
.backup-warning {
  font-size: 0.875rem;
  color: var(--pink);
  margin: 0 0 1rem;
  line-height: 1.45;
}
.key-reveal { margin-bottom: 0.85rem; }
.key-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}
.key-row code {
  flex: 1;
  min-width: 0;
  font-size: 0.75rem;
  padding: 0.55rem 0.65rem;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  word-break: break-all;
}
#backup-download { margin-bottom: 1rem; }
.wallet-section-title {
  font-family: 'DM Mono', monospace;
  font-size: 0.9375rem;
  margin: 0 0 0.35rem;
}
.wallet-autopay {
  margin-top: 1rem;
  padding: 1.5rem;
}
.wallet-autopay .field-hint {
  margin: 0 0 1rem;
}
.wallet-autopay label {
  margin-bottom: 0.35rem;
}
.ndebit-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}
.ndebit-row input { flex: 1; min-width: 0; }
.check-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: var(--text-muted); margin: 1rem 0; }
.pay-label { margin: 0 0 0.75rem; color: var(--text-muted); font-size: 0.875rem; }

.loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
  font-family: 'DM Mono', monospace;
  font-size: 0.875rem;
}

.empty-state {
  text-align: center;
  padding: 2.5rem;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

@media (max-width: 720px) {
  :root { --header-h: 112px; }

  .site-main {
    margin-top: -2rem;
    padding: 0 1rem 2.5rem;
  }

  .page-wrap { padding: 0 1rem 2.5rem; }

  .site-header {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    height: var(--header-h);
    min-height: var(--header-h);
    padding: 0.65rem 1rem 0.5rem;
    gap: 0.5rem 0.75rem;
    align-items: center;
  }

  .logo-lockup {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }

  .logo-lockup .logo-img { height: 26px; width: auto; }

  .header-meta {
    grid-column: 2;
    grid-row: 1;
    margin-left: 0;
    gap: 0.5rem;
    flex-shrink: 0;
  }

  .main-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0.35rem;
    padding: 0.35rem 0 0.25rem;
    margin: 0;
    border-top: 1px solid var(--border);
    min-width: 0;
  }

  .main-nav::-webkit-scrollbar { display: none; }

  .nav-tab {
    flex-shrink: 0;
    font-size: 0.8125rem;
    padding: 0.35rem 0.7rem;
  }

  .hero {
    min-height: clamp(340px, 64vh, 460px);
  }

  .hero-bg {
    background:
      radial-gradient(80% 60% at 50% 20%, rgba(155, 99, 255, 0.22) 0%, transparent 55%),
      linear-gradient(180deg, #1a1524 0%, var(--bg-page) 72%);
  }

  .hero-bg img {
    display: none;
  }

  .hero-bg::after {
    background: linear-gradient(
      180deg,
      rgba(20, 21, 23, 0.2) 0%,
      rgba(20, 21, 23, 0.55) 55%,
      rgba(20, 21, 23, 0.92) 100%
    );
  }

  .hero-scrim {
    background: radial-gradient(
      70% 55% at 50% 50%,
      rgba(18, 18, 20, 0.78) 0%,
      rgba(18, 18, 20, 0.4) 55%,
      transparent 100%
    );
  }

  .hero-content {
    padding: 1.5rem 1rem;
    max-width: 100%;
  }

  .hero h1 {
    font-size: 1.45rem;
    max-width: 100%;
    margin-bottom: 0.65rem;
  }

  .hero-lead {
    font-size: 0.875rem;
    max-width: 100%;
    margin-bottom: 0.65rem;
  }

  .hero-tagline {
    font-size: 0.8125rem;
    max-width: 100%;
    margin-bottom: 1rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .catalog-overlap {
    background: transparent;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

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

  .form-grid { grid-template-columns: 1fr; }
  .modal-configure { max-height: 94vh; }
  .modal-configure-footer.checkout-bar { flex-direction: column; align-items: stretch; }
  .modal-configure-footer .btn { width: 100%; }
  .ndebit-row { flex-direction: column; }
  .ndebit-row .btn { width: 100%; }
  .header-meta .rate-pill { display: none; }
}
