/* Bot Rental — premium dark UI */
:root {
  --bg: #070b12;
  --bg-soft: #0b1119;
  --card: #0f1622;
  --card-2: #131c2a;
  --card-3: #172234;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #eef4ff;
  --muted: #8b9ab3;
  --muted-2: #64748b;
  --accent: #5b8cff;
  --accent-2: #8b5cf6;
  --accent-3: #22d3ee;
  --ok: #35d6a4;
  --warn: #f7b955;
  --bad: #ff6470;
  --radius: 20px;
  --radius-sm: 14px;
  --tab-h: 74px;
  --shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.9);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(1000px 520px at 12% -8%, rgba(91, 140, 255, 0.20), transparent 60%),
    radial-gradient(760px 420px at 92% 4%, rgba(139, 92, 246, 0.16), transparent 62%),
    radial-gradient(680px 460px at 50% 108%, rgba(34, 211, 238, 0.08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}

body { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px)); }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.center { text-align: center; }

/* ------------------------------------------------------------------ boot */
.boot {
  position: fixed; inset: 0; display: grid; place-content: center;
  justify-items: center; gap: 16px; color: var(--muted); font-size: 13px;
  background: radial-gradient(600px 400px at 50% 30%, rgba(91,140,255,.12), transparent 70%);
}

.spinner {
  width: 38px; height: 38px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.10);
  border-top-color: var(--accent);
  border-right-color: var(--accent-2);
  animation: spin 0.85s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ----------------------------------------------------------------- shell */
.app { max-width: 720px; margin: 0 auto; padding: 0 16px; }

.topbar {
  position: sticky; top: 0; z-index: 8;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 2px 12px;
  background: linear-gradient(180deg, rgba(7, 11, 18, 0.94), rgba(7, 11, 18, 0.72) 72%, transparent);
  backdrop-filter: blur(18px) saturate(140%);
}

.who { display: flex; align-items: center; gap: 11px; min-width: 0; }

.avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; font-weight: 700; font-size: 15px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 1px rgba(255,255,255,.10), 0 10px 24px -12px rgba(91,140,255,.9);
}

.hello { font-weight: 650; font-size: 15px; line-height: 1.2; letter-spacing: -0.01em; }

.top-actions { display: flex; align-items: center; gap: 8px; }

.chip {
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.02));
  color: var(--text); border-radius: 999px; padding: 9px 15px;
  font-weight: 700; font-size: 13px; letter-spacing: -0.01em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10), var(--shadow);
}
.chip:active { transform: scale(.97); }

.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.02));
  color: var(--text); font-size: 16px; display: grid; place-items: center;
}
.icon-btn:active { transform: scale(.95); }

.view { padding: 4px 0 26px; animation: fadeUp .22s ease-out; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ----------------------------------------------------------------- cards */
.card {
  position: relative;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.045);
}
.card::after {
  content: ""; position: absolute; inset: 0 0 auto; height: 1px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent);
  opacity: .55; pointer-events: none;
}
.card.tight { padding: 12px; }
.card.click { cursor: pointer; transition: transform .14s ease, border-color .14s ease; }
.card.click:active { transform: scale(.994); border-color: rgba(91,140,255,.35); }

h2 { font-size: 19px; margin: 16px 2px 10px; letter-spacing: -0.02em; }
h3 { font-size: 15px; margin: 0 0 6px; letter-spacing: -0.01em; }
p { margin: 6px 0; line-height: 1.55; }

.balance-hero {
  overflow: hidden;
  padding: 24px 20px;
  background:
    radial-gradient(320px 160px at 88% 0%, rgba(139, 92, 246, 0.35), transparent 70%),
    linear-gradient(140deg, rgba(91, 140, 255, 0.22), rgba(34, 211, 238, 0.06)),
    var(--card-2);
  border-color: rgba(91, 140, 255, 0.28);
}

.balance-amount {
  font-size: 38px; font-weight: 780; letter-spacing: -1.4px;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------- buttons */
.btn {
  appearance: none; border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 13px 16px; font-weight: 650; font-size: 14px; width: 100%;
  background: linear-gradient(180deg, var(--card-3), var(--card-2));
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
  transition: transform .12s ease, filter .18s ease;
}
.btn:active { transform: scale(.985); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 12px 26px -14px rgba(91, 140, 255, 0.95), inset 0 1px 0 rgba(255,255,255,.25);
}
.btn.ok { background: rgba(53, 214, 164, 0.14); color: var(--ok); border-color: rgba(53,214,164,.25); }
.btn.bad { background: rgba(255, 100, 112, 0.13); color: var(--bad); border-color: rgba(255,100,112,.24); }
.btn.ghost {
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015));
  border: 1px solid var(--line-strong);
}
.btn.sm { padding: 9px 13px; font-size: 13px; border-radius: 11px; width: auto; }
.btn:disabled { opacity: .45; }

/* ----------------------------------------------------------------- grids */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }

.stat {
  position: relative;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line); border-radius: 16px; padding: 13px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.045);
}
.stat .k {
  font-size: 10.5px; color: var(--muted); text-transform: uppercase;
  letter-spacing: .8px; font-weight: 600;
}
.stat .v {
  font-size: 21px; font-weight: 740; margin-top: 5px;
  letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}

/* ----------------------------------------------------------------- pills */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  background: rgba(255, 255, 255, 0.06); color: var(--muted);
  border: 1px solid rgba(255,255,255,.06);
}
.pill::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; opacity: .85;
}
.pill.ok { background: rgba(53, 214, 164, 0.13); color: var(--ok); border-color: rgba(53,214,164,.22); }
.pill.warn { background: rgba(247, 185, 85, 0.13); color: var(--warn); border-color: rgba(247,185,85,.22); }
.pill.bad { background: rgba(255, 100, 112, 0.13); color: var(--bad); border-color: rgba(255,100,112,.22); }
.pill.info { background: rgba(91, 140, 255, 0.15); color: #a9c6ff; border-color: rgba(91,140,255,.28); }

.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 4px; border-bottom: 1px solid var(--line);
}
.list-item:last-child { border-bottom: 0; }

/* ----------------------------------------------------------------- forms */
.field { margin: 12px 0; }
.field label {
  display: block; font-size: 11.5px; color: var(--muted);
  margin-bottom: 6px; letter-spacing: .02em;
}
input, textarea, select {
  width: 100%; background: rgba(8, 13, 21, 0.85); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 13px;
  padding: 12px 13px; font-size: 15px; font-family: inherit;
  transition: border-color .16s ease, box-shadow .16s ease;
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: rgba(91, 140, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.16);
}
textarea { min-height: 96px; resize: vertical; }

/* ------------------------------------------------------------ bottom dock */
.tabs {
  position: fixed; left: 10px; right: 10px; z-index: 9;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  display: flex; gap: 2px;
  padding: 7px;
  background: rgba(11, 17, 25, 0.86);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  backdrop-filter: blur(22px) saturate(160%);
  box-shadow: 0 20px 44px -18px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255,255,255,.06);
}
.tab {
  flex: 1; min-width: 0; background: none; border: 0; color: var(--muted);
  display: grid; justify-items: center; gap: 3px;
  font-size: 10px; font-weight: 620; letter-spacing: .01em;
  padding: 7px 0 6px; border-radius: 15px;
  transition: color .16s ease, background .16s ease, transform .12s ease;
}
.tab span { font-size: 18px; line-height: 1; filter: saturate(.85); transition: transform .16s ease; }
.tab:active { transform: scale(.94); }
.tab.active {
  color: #fff;
  background: linear-gradient(180deg, rgba(91, 140, 255, 0.26), rgba(139, 92, 246, 0.14));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}
.tab.active span { transform: translateY(-1px) scale(1.06); filter: none; }

/* ----------------------------------------------------------------- sheet */
.sheet { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(2, 5, 10, 0.68); backdrop-filter: blur(3px); }
.sheet-body {
  position: relative; width: 100%; max-height: 90vh; overflow-y: auto;
  background: linear-gradient(180deg, #0e1622, #0a1119);
  border-radius: 26px 26px 0 0;
  padding: 8px 16px calc(22px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line-strong);
  box-shadow: 0 -22px 60px -24px rgba(0,0,0,.9);
  animation: slideUp .24s cubic-bezier(.22,.9,.3,1);
}
@keyframes slideUp { from { transform: translateY(28px); opacity: .55; } to { transform: none; opacity: 1; } }
.sheet-grab { width: 44px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.2); margin: 6px auto 14px; }

/* ----------------------------------------------------------------- toast */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + 20px);
  transform: translateX(-50%);
  max-width: min(92vw, 460px);
  background: rgba(20, 29, 43, 0.97); color: #fff;
  border: 1px solid var(--line-strong);
  padding: 12px 16px; border-radius: 15px; font-size: 13px; z-index: 40;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  animation: toastIn .18s ease-out;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.toast.bad { border-color: rgba(255, 100, 112, 0.5); }
.toast.ok { border-color: rgba(53, 214, 164, 0.5); }

/* ----------------------------------------------------------------- meters */
.meter { height: 6px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-3)); }

pre.logs {
  background: rgba(6, 10, 16, 0.92); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px; font-size: 11px; line-height: 1.55; max-height: 260px;
  overflow: auto; white-space: pre-wrap; word-break: break-word; color: #b9c6d8;
}

.env-row { border-bottom: 1px solid var(--line); padding: 12px 0; }
.env-row:last-child { border-bottom: 0; }

.empty { text-align: center; color: var(--muted); padding: 34px 12px; }
.empty .big { font-size: 38px; display: block; margin-bottom: 10px; opacity: .9; }

.amount-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.amount-grid button {
  background: linear-gradient(180deg, var(--card-3), var(--card-2));
  border: 1px solid var(--line); color: var(--text);
  border-radius: 13px; padding: 12px 0; font-weight: 650;
  transition: border-color .14s ease, color .14s ease;
}
.amount-grid button.sel {
  border-color: rgba(91, 140, 255, 0.75); color: #cfe0ff;
  background: linear-gradient(180deg, rgba(91,140,255,.26), rgba(91,140,255,.10));
}

.copy {
  display: flex; gap: 8px; align-items: center;
  background: rgba(6, 10, 16, 0.9); border: 1px dashed rgba(255,255,255,.18);
  border-radius: 13px; padding: 12px; font-size: 12px; word-break: break-all;
}

/* --------------------------------------------------------------- profile */
.profile-hero {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 14px;
  padding: 20px 18px;
  border-radius: var(--radius);
  border: 1px solid rgba(91, 140, 255, 0.24);
  background:
    radial-gradient(280px 160px at 90% -10%, rgba(139, 92, 246, 0.35), transparent 70%),
    radial-gradient(260px 170px at 0% 110%, rgba(34, 211, 238, 0.16), transparent 70%),
    linear-gradient(160deg, rgba(91, 140, 255, 0.16), rgba(15, 22, 34, 0.9));
  box-shadow: var(--shadow);
  margin-bottom: 4px;
}

.pavatar {
  width: 76px; height: 76px; border-radius: 50%; object-fit: cover; flex: 0 0 auto;
  border: 2px solid rgba(255,255,255,.16);
  box-shadow: 0 14px 34px -16px rgba(91,140,255,.95), inset 0 0 0 1px rgba(255,255,255,.08);
  background: var(--card-2);
}
.pavatar-fallback {
  display: grid; place-items: center; font-size: 30px; font-weight: 780;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}

.pmeta { min-width: 0; }
.pname {
  font-size: 19px; font-weight: 740; letter-spacing: -0.02em;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.phandle { color: var(--muted); font-size: 13px; margin-top: 3px; }
.pchips { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }

.badge-premium {
  font-size: 9.5px; font-weight: 800; letter-spacing: .09em;
  padding: 3px 7px; border-radius: 6px;
  color: #0b1119;
  background: linear-gradient(135deg, #ffd76e, #f7b955);
}

.prow {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; padding: 13px 0; border-bottom: 1px solid var(--line);
  background: none; border-left: 0; border-right: 0; border-top: 0;
  color: var(--text); text-align: left; font: inherit;
}
.prow:last-child { border-bottom: 0; }
.prow-k { color: var(--muted); font-size: 13px; }
.prow-v {
  color: var(--text); font-size: 13.5px; font-weight: 600;
  background: none; border: 0; padding: 0;
  display: inline-flex; align-items: center; gap: 6px;
}
.prow-btn { cursor: pointer; }
.prow-btn:active { opacity: .7; }

/* -------------------------------------------------------- admin payments */
.prov { padding: 16px; }
.switch-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.switch-row:last-of-type { border-bottom: 0; }

.switch { position: relative; display: inline-flex; width: 46px; height: 27px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; }
.switch i {
  position: absolute; inset: 0; border-radius: 999px;
  background: rgba(255,255,255,.12); border: 1px solid var(--line-strong);
  transition: background .18s ease, border-color .18s ease;
}
.switch i::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 19px; height: 19px; border-radius: 50%;
  background: #cfd8e6; transition: transform .18s ease, background .18s ease;
}
.switch input:checked + i {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
}
.switch input:checked + i::after { transform: translateX(19px); background: #fff; }

@media (max-width: 380px) {
  .avatar { width: 38px; height: 38px; }
  .balance-amount { font-size: 33px; }
  .tab { font-size: 9.5px; }
  .tab span { font-size: 17px; }
}

/* ------------------------------------------------------------ stale link */
.banner {
  position: sticky; top: 0; z-index: 12;
  margin: 0 0 10px;
  padding: 11px 13px;
  border-radius: 14px;
  font-size: 12px; line-height: 1.45;
  color: #ffe1a8;
  background: linear-gradient(180deg, rgba(247,185,85,.20), rgba(247,185,85,.10));
  border: 1px solid rgba(247, 185, 85, 0.35);
  box-shadow: 0 10px 24px -18px rgba(0,0,0,.9);
}

/* payment steps (premium card) */
.paysteps { margin: 14px 0 4px; display: grid; gap: 12px; }
.paystep { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; }
.paystep .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; background: rgba(91,140,255,.16); color: #9dbcff; }
.copyblock { width: 100%; display: flex; justify-content: space-between; align-items: center;
  gap: 10px; margin-top: 6px; padding: 12px 14px; border-radius: 14px; cursor: pointer;
  background: rgba(255,255,255,.05); border: 1px dashed rgba(255,255,255,.18); color: inherit;
  font-size: 16px; font-weight: 600; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.copyblock:active { background: rgba(255,255,255,.09); }
.copyblock .cp { font-size: 13px; opacity: .55; }
.tiny { font-size: 11.5px; line-height: 1.45; }
