:root {
  --bg: #07060f;
  --surface: #0f0d1a;
  --surface-2: #161326;
  --surface-hover: #1c1830;
  --border: rgba(255, 255, 255, 0.085);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f5f4fa;
  --text-muted: #9892ae;
  --text-dim: #6c6683;
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --accent-soft: rgba(124, 58, 237, 0.14);
  --accent-border: rgba(124, 58, 237, 0.42);
  --green: #10b981;
  --green-soft: rgba(16, 185, 129, 0.12);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.14);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.13);
  --sans: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, ui-monospace, monospace;
  --sidebar-w: 220px;
  --header-h: 58px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

/* Top Header */


.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
  flex-shrink: 0;
}


.role-tag {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: #c4b5fd;
  border: 1px solid var(--accent-border);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
  white-space: nowrap;
}

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

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

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}


.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover:not(:disabled) {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.btn-green {
  background: var(--green-soft);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.btn-green:hover:not(:disabled) {
  background: rgba(16, 185, 129, 0.2);
}

.btn-danger {
  background: var(--red-soft);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.24);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

/* Main Shell */
.shell {
  display: flex;
  padding-top: var(--header-h);
  min-height: 100vh;
}


.nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}

.nav-item:hover {
  background: var(--surface);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: #ffffff;
}

.nav-item-left {
  display: flex;
  align-items: center;
  gap: 9px;
}

.nav-badge {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-family: var(--mono);
}

.nav-item.active .nav-badge {
  background: rgba(124, 58, 237, 0.32);
  color: #e9d5ff;
}


.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 22px 26px 48px;
  max-width: 1460px;
}

/* Telemetry Strip */
.telemetry-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.metric-cell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 13px 16px;
}

.metric-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.metric-val {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

.metric-val.green {
  color: #34d399;
}

.metric-sub {
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* Section Headers */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.section-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Filters */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.chip-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  padding: 5px 11px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.14s;
}

.chip:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.chip.active {
  background: #ffffff;
  border-color: #ffffff;
  color: #090811;
  font-weight: 600;
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.input, .select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--text);
  font-size: 13px;
  outline: none;
}

.input:focus, .select:focus {
  border-color: var(--accent);
}

/* Compute Node Table */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow-x: auto;
}

table.node-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 880px;
}

.node-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.015);
  white-space: nowrap;
}

.node-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.node-table tbody tr:last-child td {
  border-bottom: none;
}

.node-table tbody tr:hover {
  background: var(--surface-2);
}

.gpu-primary {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
}

.gpu-count-badge {
  font-size: 11.5px;
  font-family: var(--mono);
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: #d8b4fe;
  border: 1px solid var(--accent-border);
}

.tier-tag {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.tier-tag.dev {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
}

.cell-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.status-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #34d399;
}

.price-main {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

/* Instance Cards */
.instance-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.inst-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
}

.inst-card.destroyed {
  opacity: 0.62;
}

.inst-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.inst-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.inst-name {
  font-size: 15.5px;
  font-weight: 600;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}

.status-pill.running {
  background: var(--green-soft);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.status-pill.provisioning {
  background: var(--amber-soft);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.status-pill.stopped {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.status-pill.destroyed, .status-pill.error {
  background: var(--red-soft);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.inst-specs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 11px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 12px;
}

.spec-k {
  font-size: 11.5px;
  color: var(--text-dim);
}

.spec-v {
  font-size: 13px;
  font-weight: 500;
  margin-top: 2px;
}

.inst-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.action-left, .action-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ssh-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}

.verify-box {
  margin-top: 12px;
  padding: 11px 14px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 12.5px;
}

.verify-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #34d399;
  font-weight: 600;
  margin-bottom: 6px;
}

.verify-gpu-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
}

/* Panels & Forms */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
}

.panel h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
}

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

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}

.form-field label {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* Right Slide-Over Drawer (Deploy) */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 2, 8, 0.72);
  backdrop-filter: blur(4px);
  z-index: 60;
  display: none;
}

.backdrop.open {
  display: block;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  height: 100dvh;
  max-height: 100vh;
  width: min(460px, 100vw);
  background: var(--surface);
  border-left: 1px solid var(--border-strong);
  z-index: 70;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.2s ease;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-head {
  flex-shrink: 0;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-body {
  padding: 14px 18px;
  overflow-y: auto;
  flex: 0 1 auto;
  min-height: 0;
}

.drawer-foot {
  flex-shrink: 0;
  padding: 14px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.tpl-option {
  padding: 9px 12px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  margin-bottom: 7px;
  transition: border-color 0.14s, background 0.14s;
}

.tpl-option:hover {
  border-color: var(--border-strong);
}

.tpl-option.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.tpl-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 13.5px;
  margin-bottom: 3px;
}

.tpl-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.cost-summary {
  padding: 12px 14px;
  border-radius: 7px;
  background: var(--bg);
  border: 1px solid var(--border);
  margin-bottom: 12px;
}

.cost-line {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 5px;
  color: var(--text-muted);
}

.cost-line.total {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
  font-size: 14.5px;
  margin-bottom: 0;
}

/* Auth Modal */
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(400px, 92vw);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 22px;
  z-index: 80;
  display: none;
}

.modal.open {
  display: block;
}

.tabs-inline {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  background: var(--bg);
  padding: 4px;
  border-radius: 7px;
  border: 1px solid var(--border);
}

.tab-btn {
  flex: 1;
  padding: 7px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 500;
}

.tab-btn.active {
  background: var(--surface-2);
  color: var(--text);
}

.quick-creds {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}

.quick-creds-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}

/* Toast */
.toast-wrap {
  position: fixed;
  top: 70px;
  right: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 10px 14px;
  border-radius: 7px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 13px;
  max-width: 380px;
}

.toast.ok {
  border-color: rgba(16, 185, 129, 0.5);
}

.toast.err {
  border-color: rgba(239, 68, 68, 0.55);
  color: #fecaca;
}

.empty-state {
  padding: 44px 20px;
  text-align: center;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.empty-state h4 {
  color: var(--text);
  font-size: 15px;
  margin-bottom: 6px;
}

.hidden {
  display: none !important;
}

/* Compact laptop / split-screen breakpoint */
@media (max-width: 1180px) {
  :root {
    --sidebar-w: 192px;
  }
  .main {
    padding: 18px 18px 42px;
  }
}

/* Tablet & half-screen window: zero horizontal overflow, responsive GPU cards */
@media (max-width: 960px) {
  .nav-list {
    flex-direction: row;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .nav-list::-webkit-scrollbar {
    display: none;
  }
  .nav-item {
    padding: 7px 11px;
    font-size: 13px;
    flex-shrink: 0;
  }
  .shell {
    flex-direction: column;
  }
  .main {
    margin-left: 0;
    padding: 16px 14px 40px;
    max-width: 100%;
  }
  .telemetry-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
  }
  .inst-specs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .filter-controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }
  .filter-controls .select {
    width: 100%;
    min-width: 0;
  }

  /* Transform GPU catalog table into clean responsive cards (NO horizontal scroll!) */
  .catalog-wrap {
    background: transparent;
    border: none;
    overflow: visible;
  }
  table.catalog-table {
    display: block;
    min-width: 0;
    width: 100%;
  }
  table.catalog-table thead {
    display: none;
  }
  table.catalog-table tbody {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  table.catalog-table tbody tr:not(.node-row) {
    display: block;
    grid-column: 1 / -1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
  }
  table.catalog-table tbody tr:not(.node-row) td {
    display: block;
    border: none;
  }
  table.catalog-table tbody tr.node-row {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "gpu rate"
      "region region"
      "compute sla"
      "action action";
    gap: 8px 10px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 9px;
  }
  table.catalog-table tbody tr.node-row:hover {
    background: var(--surface-2);
  }
  table.catalog-table tbody tr.node-row td {
    display: block;
    padding: 0;
    border: none;
  }
  table.catalog-table .td-gpu {
    grid-area: gpu;
    min-width: 0;
  }
  table.catalog-table .td-rate {
    grid-area: rate;
    text-align: right;
  }
  table.catalog-table .td-region {
    grid-area: region;
    padding-top: 6px;
    border-top: 1px solid var(--border);
  }
  table.catalog-table .td-compute {
    grid-area: compute;
  }
  table.catalog-table .td-sla {
    grid-area: sla;
    text-align: right;
  }
  table.catalog-table .td-action {
    grid-area: action;
    text-align: left !important;
    padding-top: 4px;
  }
  table.catalog-table .td-action .deploy-btn {
    width: 100%;
    padding: 9px 12px;
    font-size: 13px;
  }
  .gpu-primary {
    flex-wrap: wrap;
    gap: 6px;
  }
  .ssh-box {
    max-width: 100%;
    overflow-x: auto;
    font-size: 11.5px;
  }
  .verify-gpu-row {
    gap: 8px 12px;
    font-size: 11.5px;
  }
}

/* Mobile Phone breakpoint (360px - 640px) */
@media (max-width: 640px) {
  :root {
    --header-h: 54px;
  }
  .nav-list {
    gap: 4px;
  }
  .nav-item {
    padding: 6px 8px;
    font-size: 12px;
    gap: 5px;
  }
  .nav-item-left {
    gap: 5px;
  }
  .nav-badge {
    font-size: 10.5px;
    padding: 1px 5px;
  }
  #user-email-label {
    display: none;
  }
  .main {
    padding: 12px 12px 36px;
  }
  .metric-cell {
    padding: 10px 12px;
  }
  .metric-val {
    font-size: 17px;
  }
  .metric-sub {
    font-size: 11px;
  }
  .section-title {
    font-size: 16px;
  }
  .section-desc {
    font-size: 12px;
  }
  .chip-group {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .chip-group::-webkit-scrollbar {
    display: none;
  }
  .chip {
    flex-shrink: 0;
    padding: 6px 10px;
    font-size: 12px;
  }
  .filter-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #filter-sort {
    grid-column: 1 / -1;
  }
  table.catalog-table tbody {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .inst-card {
    padding: 13px;
  }
  .inst-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .action-left, .action-right {
    width: 100%;
  }
  .action-left .btn, .action-right .btn {
    flex: 1;
  }
  .drawer {
    width: 100vw;
  }
  .modal {
    width: calc(100vw - 24px);
    max-height: 90vh;
    overflow-y: auto;
    padding: 18px;
  }
  .toast-wrap {
    top: 62px;
    left: 12px;
    right: 12px;
  }
  .toast {
    max-width: none;
    width: 100%;
  }
}

.cost-notes {
  margin-top: 8px;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-muted);
}
.cost-notes div + div {
  margin-top: 2px;
}

/* ---------- Owned facility notice (links back to the website quote form) ---------- */
.owned-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 14px;
  padding: 14px 18px;
  border: 1px solid var(--amber-soft);
  border-left: 3px solid var(--amber);
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.05);
}
.owned-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}
.owned-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  flex: none;
}
.owned-desc {
  margin: 5px 0 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-muted);
}
.owned-strip .btn {
  flex: none;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .owned-strip {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---------- USDT top-up ---------- */
.topup-grid {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.topup-qr {
  flex: none;
  width: 168px;
  height: 168px;
  padding: 8px;
  border-radius: 10px;
  background: #fff;
}
.topup-qr svg {
  display: block;
  width: 100%;
  height: 100%;
}
.topup-info {
  flex: 1;
  min-width: 0;
}
.topup-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
.topup-row .spec-k {
  flex: none;
  width: 92px;
}
.topup-val {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  color: var(--text);
}
.topup-addr {
  word-break: break-all;
  font-size: 13px;
}
.topup-net {
  flex: 1;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--amber);
}
.topup-warn {
  margin: 10px 0 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--amber);
}
.topup-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
}
.topup-status.confirming {
  color: var(--green);
}
.topup-done {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 0;
}
.topup-done > div:nth-child(2) {
  flex: 1;
  min-width: 0;
}
.topup-done-mark {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 700;
}
.topup-done-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--green);
}
@media (max-width: 640px) {
  .topup-grid {
    flex-direction: column;
    align-items: stretch;
  }
  .topup-qr {
    align-self: center;
  }
  .topup-row {
    flex-wrap: wrap;
  }
  .topup-row .spec-k {
    width: 100%;
  }
}

/* ---------- Pool utilisation + in-use rows ---------- */
.pool-bar {
  margin: 0 0 18px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.pool-nums {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 34px;
  font-size: 12.5px;
  color: var(--text-muted);
}
.pool-nums b {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-right: 4px;
}
.pool-nums b.busy {
  color: var(--amber);
}
.pool-nums b.free {
  color: var(--green);
}
.pool-nums i {
  font-style: normal;
  margin-left: 6px;
}
.pool-track {
  height: 6px;
  margin-top: 12px;
  border-radius: 999px;
  background: var(--green-soft);
  overflow: hidden;
}
.pool-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--amber);
}
.busy-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  display: inline-block;
}
.status-inline.busy {
  color: var(--amber);
}
tr.node-row.busy .gpu-primary,
tr.node-row.busy .td-compute,
tr.node-row.busy .td-region,
tr.node-row.busy .td-rate {
  opacity: 0.62;
}
.tier-tag.warn {
  color: var(--amber);
  border-color: var(--amber-soft);
  background: rgba(245, 158, 11, 0.08);
}
.td-sla .status-inline {
  white-space: nowrap;
}
.deploy-btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.td-sla .cell-sub {
  white-space: nowrap;
}

/* ---------- Hints: top-up notes, payments needing the owner ---------- */
.topup-tips {
  margin-top: 14px;
  padding: 12px 16px;
  border: 1px solid var(--amber-soft);
  border-left: 3px solid var(--amber);
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.05);
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--text-muted);
}
.topup-tips b {
  color: var(--amber);
  font-weight: 600;
}
.topup-tips ul {
  margin: 4px 0 0;
  padding-left: 18px;
}
.topup-tips a {
  color: var(--text);
  text-decoration: underline;
}
.adm-alert {
  margin: 0 0 10px;
  padding: 10px 14px;
  border: 1px solid var(--red);
  border-radius: 8px;
  background: var(--red-soft);
  color: #fecaca;
  font-size: 13px;
  line-height: 1.6;
}
.nav-alert {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.nav-alert.hidden {
  display: none;
}

/* ---------- Top-up: currency / network picker ---------- */
.topup-pick {
  margin-bottom: 14px;
}
.topup-pick .spec-k {
  margin-bottom: 6px;
}
.topup-pick .chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip-rec {
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 10.5px;
  background: var(--green-soft);
  color: var(--green);
}
.topup-memo .topup-val {
  color: var(--amber);
  font-weight: 600;
}
.topup-bank-link {
  color: var(--text);
  text-decoration: underline;
}

/* password recovery (2026-11-24) */
.link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 12.5px;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.auth-note {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0 0 14px;
}

.auth-result {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  background: var(--green-soft);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 7px;
  padding: 10px 12px;
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}

.auth-result.warn {
  background: var(--amber-soft);
  border-color: rgba(245, 158, 11, 0.4);
}

.reset-box {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg);
}

.reset-box-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.reset-box-link {
  font-family: var(--mono);
  font-size: 12.5px;
  word-break: break-all;
  margin: 10px 0;
  padding: 8px 10px;
  border: 1px dashed var(--border-strong);
  border-radius: 6px;
  user-select: all;
}

.reset-box-foot {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.reset-box-foot .cell-sub {
  margin: 0;
  line-height: 1.6;
}

/* language menu: copied from the website stylesheet so it is the same control (2026-11-24) */
.lang-select{position:relative}
.lang-trigger{display:inline-flex;align-items:center;gap:7px;min-height:40px;padding:0 12px;border-radius:999px;border:1px solid #ffffff29;background:#ffffff0f;color:#efeafc;font:inherit;font-size:13px;white-space:nowrap;cursor:pointer}
.lang-trigger:hover{background:#ffffff1f}
.lang-menu{position:absolute;top:calc(100% + 8px);inset-inline-end:0;z-index:60;list-style:none;margin:0;padding:8px;display:grid;grid-template-columns:repeat(2,minmax(150px,1fr));gap:2px;max-height:min(70vh,560px);overflow:auto;background:#fffffff5;border:1px solid #e7dfee;border-radius:14px;box-shadow:0 24px 60px #1a0a2e38;-webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px)}
.lang-menu.hidden{display:none}
.lang-menu button{width:100%;display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:44px;padding:0 12px;border:none;background:none;border-radius:9px;color:#33233f;font:inherit;font-size:14px;text-align:start;cursor:pointer}
.lang-menu button:hover,.lang-menu button:focus-visible{background:#f3edf8;outline:none}
.lang-menu button[aria-selected=true]{background:#ede4f6;color:#432063;font-weight:600}
@media(max-width:780px){.lang-trigger{min-height:44px}.lang-menu{position:fixed;top:68px;inset-inline:12px;grid-template-columns:repeat(2,minmax(0,1fr));max-height:calc(100vh - 160px);max-height:calc(100dvh - 160px)}}
@media(max-width:580px){.lang-trigger{padding:0 10px;gap:5px;font-size:12.5px}.lang-trigger>span{max-width:76px;overflow:hidden;text-overflow:ellipsis}}
@media(max-width:380px){.lang-trigger>span{max-width:64px}}

/* right-to-left languages (ar, fa, ur): mirror the frame; technical values keep their own order (see fixBidi in app.js) */
[dir="rtl"] .drawer{right:auto;left:0;border-left:none;border-right:1px solid var(--border-strong);transform:translateX(-100%)}
[dir="rtl"] .drawer.open{transform:translateX(0)}
[dir="rtl"] body [dir="ltr"]:not(button):not(input){text-align:match-parent}
[dir="rtl"] input[type="email"],[dir="rtl"] input[type="password"],[dir="rtl"] input[type="number"]{direction:ltr;text-align:right}

/* =====================================================================================
   One site with www.computeshare.ai (owner picked design B, 2026-11-24).
   Header, footer, contact button and font: values copied from the website stylesheet (its dark home page).
   ===================================================================================== */
:root{--sans:"PingFang SC","Microsoft YaHei","Noto Sans SC","Segoe UI Variable Text","Segoe UI",system-ui,-apple-system,"Helvetica Neue",Arial,"Noto Sans",sans-serif;--header-h:76px;--night-line:rgba(255,255,255,.09);--night-muted:#a59fbd}
body{color:#ece9f7;font-family:var(--sans)}
.cs-top{position:fixed;inset-inline:0;top:0;height:76px;z-index:40;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:0 32px;background:#07060fc7;border-bottom:1px solid #ffffff17;-webkit-backdrop-filter:blur(18px) saturate(1.3);backdrop-filter:blur(18px) saturate(1.3);box-shadow:0 1px #ffffff0a,0 10px 30px #00000040}
.cs-brand{display:flex;align-items:center;gap:22px;min-width:0}
.cs-logo{display:block;line-height:0;flex-shrink:0}
.cs-logo img{width:174px;height:auto;display:block}
.cs-sub{font-size:15px;font-weight:600;letter-spacing:.03em;color:#b8aed0;border-inline-start:1px solid #ffffff24;padding-inline-start:22px;white-space:nowrap}
.cs-nav{display:flex;gap:6px;margin-inline-start:auto}
.cs-nav a{color:#cfc8e4;font-size:14px;padding:10px 14px;border-radius:999px;text-decoration:none;white-space:nowrap;transition:background .2s,color .2s}
.cs-nav a:hover{background:#ffffff12;color:#fff}
.cs-right{display:flex;align-items:center;gap:18px}
.cs-pill{display:inline-flex;align-items:center;min-height:42px;padding:0 16px;border-radius:999px;font-size:14px;font-weight:600;white-space:nowrap;color:#fff;border:1px solid #ffffff47;text-decoration:none;transition:background .2s,border-color .2s}
.cs-pill:hover{background:#ffffff1a;border-color:#ffffff80}
.cs-cta{display:inline-flex;align-items:center;gap:8px;min-height:42px;padding:0 18px;border-radius:999px;border:none;background:#fff;color:#1b1030;font:inherit;font-weight:600;font-size:14px;white-space:nowrap;cursor:pointer;transition:box-shadow .2s}
.cs-cta:hover{box-shadow:0 0 0 4px #8b5cf659}
.cs-cta.hidden,.cs-balance.hidden,.cs-user.hidden{display:none}
.cs-balance{display:inline-flex;align-items:center;min-height:42px;padding:0 16px;border-radius:999px;border:1px solid rgba(16,185,129,.45);background:rgba(16,185,129,.12);color:#34d399;font:inherit;font-weight:600;font-size:14px;font-variant-numeric:tabular-nums;white-space:nowrap;cursor:pointer}
.cs-user{display:inline-flex;align-items:center;gap:10px;min-height:42px;padding-block:0;padding-inline:16px 6px;border-radius:999px;border:1px solid #ffffff29;background:#ffffff0f;font-size:13px;color:#efeafc;min-width:0}
.cs-user #user-email-label{max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cs-out{min-height:30px;padding:0 12px;border-radius:999px;border:none;background:#ffffff1f;color:#fff;font:inherit;font-size:12.5px;white-space:nowrap;cursor:pointer}
.cs-out:hover{background:#ffffff33}
.cs-footer{max-width:1200px;margin:56px auto 0;padding:30px 0 110px;display:flex;flex-wrap:wrap;align-items:center;gap:12px 28px;color:var(--night-muted);font-size:13px;border-top:1px solid var(--night-line)}
.cs-footer img{width:140px;height:auto}
.cs-fab{position:fixed;inset-inline-end:24px;bottom:24px;z-index:55;display:inline-flex;align-items:center;gap:10px;min-height:52px;padding-block:0;padding-inline:16px 20px;border-radius:999px;color:#fff;font-weight:600;font-size:14px;text-decoration:none;background:linear-gradient(135deg,#8b5cf6,#5b21b6);box-shadow:0 12px 32px #5b21b661,inset 0 1px #ffffff4d;transition:transform .2s,box-shadow .2s}
.cs-fab:hover{transform:translateY(-2px);box-shadow:0 18px 40px #5b21b673}
[dir="rtl"] .cs-fab{background:linear-gradient(-135deg,#8b5cf6,#5b21b6)}

/* Tabs instead of a side menu; content centred like the website sections; the website's rounded shapes and numbers. */
.shell{display:block}
.cs-tabs{position:-webkit-sticky;position:sticky;top:var(--header-h);z-index:30;padding:0 24px;border-bottom:1px solid var(--night-line);background:#07060fe6;-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px)}
.nav-list{max-width:1200px;margin:0 auto;display:flex;flex-direction:row;gap:6px;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch}
.nav-list::-webkit-scrollbar{display:none}
.nav-item{flex-shrink:0;width:auto;gap:9px;padding:17px 14px 15px;border:none;border-bottom:2px solid transparent;border-radius:0;background:none;color:#cfc8e4;font-size:14px}
.nav-item:hover{background:none;color:#fff}
.nav-item.active{background:none;color:#fff;font-weight:600;border-color:transparent;border-bottom-color:#8b5cf6}
.main{margin:0 auto;max-width:1248px;padding:32px 24px 0}
.btn{border-radius:999px}
.btn-sm{padding-inline:14px}
.btn-primary{border:none;background:linear-gradient(135deg,#8b5cf6,#5b21b6);box-shadow:0 10px 28px #5b21b659,inset 0 1px #ffffff40}
.btn-primary:hover:not(:disabled){background:linear-gradient(135deg,#9d74f8,#6d28d9)}
[dir="rtl"] .btn-primary{background:linear-gradient(-135deg,#8b5cf6,#5b21b6)}
.chip{border-radius:999px;padding:7px 15px}
.input,select{border-radius:12px}
.telemetry-bar{gap:0;border:1px solid var(--night-line);border-radius:18px;background:#ffffff05;overflow:hidden;margin-bottom:24px}
.metric-cell{border:none;border-radius:0;background:none;border-inline-start:1px solid var(--night-line);padding:22px 24px}
.metric-cell:first-child{border-inline-start:none}
.metric-val{font-family:var(--sans);font-size:30px;font-weight:700;letter-spacing:-.01em}
.metric-label{font-size:13px;margin-bottom:6px}
.mono,.tabular{font-family:var(--sans);font-variant-numeric:tabular-nums}
.pool-bar,.panel,.table-wrap,.owned-strip,.inst-card{border-radius:16px}
.section-title{font-size:26px;font-weight:700;letter-spacing:-.01em}
.section-desc{font-size:14px;color:var(--night-muted)}
/* deposit addresses, codes and commands stay in a fixed-width face: every character must be unmistakable */
#topup-pay-address,#adm-reset-link,.reset-box-link,code,pre,.ssh-box,.cmd-box{font-family:var(--mono)}
@media(max-width:1320px){.cs-right:has(#user-pill:not(.hidden)) .cs-pill{display:none}.cs-user #user-email-label{max-width:150px}}
@media(max-width:1250px){.cs-top{padding:0 23px}.cs-brand{gap:16px}.cs-logo img{width:154px}.cs-sub{font-size:13px;padding-inline-start:16px}}
@media(max-width:1100px){.cs-nav{display:none}}
@media(max-width:960px){.cs-tabs{padding:0 10px}.nav-item{padding:13px 10px 11px;font-size:13px}.main{padding:20px 14px 0;max-width:100%}
  .telemetry-bar{grid-template-columns:repeat(2,minmax(0,1fr))}.metric-cell{padding:16px}.metric-cell:nth-child(odd){border-inline-start:none}.metric-cell:nth-child(n+3){border-top:1px solid var(--night-line)}.metric-val{font-size:24px}}
@media(max-width:780px){:root{--header-h:66px}.cs-top{height:66px;padding-inline:14px}.cs-logo img{width:150px}.cs-right{gap:10px}.cs-cta{min-height:44px;padding:0 14px;font-size:13px}.cs-pill,.cs-fab{display:none}.cs-footer{padding-bottom:40px}}
@media(max-width:580px){:root{--header-h:62px}.cs-top{height:62px;padding-inline:12px;gap:8px}.cs-brand{gap:8px}.cs-logo img{width:118px}.cs-sub{display:none}.cs-right{gap:8px}.cs-user{padding-inline:6px}.cs-user #user-email-label{display:none}.cs-balance{min-height:44px;padding:0 12px;font-size:13px}}

/* billing: one balance card (the voucher box is gone), settings panel on its own row in the owner panel */
.bill-balance{display:flex;align-items:center;justify-content:space-between;gap:20px 32px;flex-wrap:wrap;margin-bottom:16px}
.bill-balance-side{display:flex;align-items:center;gap:14px 20px;flex-wrap:wrap;max-width:680px}
.bill-balance-side .section-desc{margin:0;flex:1;min-width:240px}
.grid-1{margin-bottom:18px}

/* modes in two groups, "what you get" line, "how to use it" on machine cards (2026-11-24) */
.tpl-group{display:flex;align-items:center;gap:8px;margin:16px 0 8px;font-size:13.5px;font-weight:700;color:#fff}
.tpl-group:first-child{margin-top:0}
.tpl-group::before{content:"";flex-shrink:0;width:8px;height:8px;border-radius:50%;background:#34d399}
.tpl-group.dev::before{background:#a59fbd}
.tpl-option{border-radius:12px;padding:11px 14px}
.tpl-see{margin-top:6px;font-size:12.5px;line-height:1.6;color:#cfc8e4}
.tpl-see b{font-weight:600;color:#fff}
.howto{margin-top:12px;padding:12px 16px;border:1px solid var(--night-line);border-radius:12px;background:#ffffff05;font-size:13px;line-height:1.75;color:#cfc8e4}
.howto b{display:block;margin-bottom:2px;color:#fff}
.howto ol{margin:0;padding-inline-start:20px}
.howto p{margin:0}
.howto .howto-switch{margin-top:6px;color:var(--night-muted)}

/* errors of the sign-in dialog, shown inside it (2026-11-24) */
.auth-error{margin:0 0 10px;padding:9px 12px;border-radius:10px;border:1px solid rgba(239,68,68,.42);background:var(--red-soft);color:#fecaca;font-size:13px;line-height:1.6;overflow-wrap:anywhere}

/* support requests and legal links (2026-11-24) */
.sup-hp{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;border:0!important;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);opacity:0;pointer-events:none}
textarea.input{resize:vertical;min-height:84px;line-height:1.6;font-family:var(--sans)}
select.input{cursor:pointer}
.cs-fab{border:none;cursor:pointer;font-family:inherit;line-height:inherit}
.nav-dot{width:8px;height:8px;border-radius:50%;background:#a78bfa;box-shadow:0 0 0 3px #8b5cf640;flex-shrink:0}
.nav-dot.hidden{display:none}
.sup-form{margin-bottom:16px}
.sup-form .form-field{max-width:720px}
.sup-ticket{border:1px solid var(--night-line);border-radius:14px;padding:14px 16px;margin-bottom:12px;background:#ffffff05}
.sup-ticket.unread{border-color:#8b5cf680}
.sup-ticket-head{display:flex;flex-wrap:wrap;align-items:center;gap:8px 10px;margin-bottom:10px}
.sup-st{display:inline-flex;align-items:center;padding:2px 10px;border-radius:999px;font-size:12px;font-weight:600;white-space:nowrap}
.sup-st.st-open{color:#fcd34d;background:#fbbf2424}
.sup-st.st-answered{color:#34d399;background:#10b98124}
.sup-st.st-closed{color:#a59fbd;background:#ffffff12}
.sup-new{color:#fff;background:#8b5cf6;border-radius:999px;padding:2px 10px;font-size:12px;font-weight:600}
.sup-thread{display:flex;flex-direction:column;gap:8px;margin-bottom:10px}
.sup-msg{max-width:min(680px,92%);padding:9px 12px;border-radius:12px;border:1px solid var(--night-line);background:#ffffff08}
.sup-msg.customer{align-self:flex-end;background:#8b5cf61f;border-color:#8b5cf640}
.sup-msg.staff{align-self:flex-start}
.sup-who{font-size:12px;color:var(--night-muted);margin-bottom:3px}
.sup-body{white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px;line-height:1.7}
.sup-reply{display:flex;gap:8px;align-items:flex-end}
.sup-reply textarea{flex:1;min-height:60px}
.adm-ticket{border:1px solid var(--night-line);border-radius:12px;margin-bottom:10px;background:#ffffff05}
.adm-ticket.st-open{border-color:#fbbf2459}
.adm-ticket summary{cursor:pointer;padding:10px 14px;display:flex;flex-wrap:wrap;align-items:center;gap:8px 10px;list-style:none}
.adm-ticket summary::-webkit-details-marker{display:none}
.adm-ticket-body{padding:0 14px 14px}
.adm-ticket-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
.adm-ticket-body textarea{display:block;width:100%}
.sup-form .auth-result,.sup-form .auth-error{max-width:720px}
.section-desc a{color:#c4b5fd;text-decoration:none}
.section-desc a:hover{text-decoration:underline}
.cs-legal{display:flex;flex-wrap:wrap;gap:6px 16px;margin-inline-start:auto}
.cs-legal a{color:var(--night-muted);text-decoration:none;font-size:13px}
.cs-legal a:hover{color:#fff}
.auth-agree{margin-top:10px}
.auth-agree a,#topup-agree a{color:#c4b5fd}
@media(max-width:580px){.sup-reply{flex-direction:column;align-items:stretch}.cs-legal{margin-inline-start:0;width:100%}}

/* signed-in header on phones (2026-11-24): language = globe only, "Sign out" = icon, no "Admin" tag */
.cs-out-ico{display:none}
[dir="rtl"] .cs-out-ico{transform:scaleX(-1)}
@media(max-width:580px){.cs-right:has(#user-pill:not(.hidden)) #lang-current,.cs-right:has(#user-pill:not(.hidden)) .lang-trigger>svg:last-child{display:none}.cs-right:has(#user-pill:not(.hidden)) .lang-trigger{width:44px;padding:0;justify-content:center}.cs-user{padding-inline:4px}.cs-user .role-tag{display:none}.cs-out{display:inline-flex;align-items:center;justify-content:center;width:36px;min-height:36px;padding:0}.cs-out>span{display:none}.cs-out-ico{display:block}}
@media(max-width:420px){.cs-logo img{width:104px}.cs-balance{padding:0 10px;font-size:12.5px}.cs-right{gap:6px}}
