:root {
  --bg0: #070d16;
  --bg1: #0c1624;
  --card: rgba(14, 24, 40, 0.88);
  --card-solid: #101c2c;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #eaf2fb;
  --muted: #87a0ba;
  --accent: #2dd4bf;
  --accent2: #38bdf8;
  --accent-deep: #0d9488;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #fb7185;
  --radius: 20px;
  --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "Manrope", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg0);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
body {
  padding-bottom: calc(var(--tab-h) + var(--safe-b) + 12px);
}
button, a { -webkit-tap-highlight-color: transparent; }

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(780px 420px at 8% -8%, rgba(45, 212, 191, 0.2), transparent 58%),
    radial-gradient(640px 380px at 100% 4%, rgba(56, 189, 248, 0.14), transparent 52%),
    radial-gradient(500px 300px at 50% 100%, rgba(13, 148, 136, 0.1), transparent 60%),
    linear-gradient(180deg, #070d16 0%, #0a1420 48%, #060b12 100%);
}

.shell {
  max-width: 480px;
  margin: 0 auto;
  padding: 8px 16px 24px;
}

/* ── Views ── */
.view {
  animation: viewIn 0.32s ease both;
}
.view[hidden] { display: none !important; }
.admin-pane[hidden],
.panel[hidden],
.import-apps[hidden] { display: none !important; }
/* Ensure [hidden] wins over display:flex/grid utility rules */
[hidden] { display: none !important; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.view-head { padding: 18px 4px 14px; }
.view-head.compact { padding-bottom: 10px; }
.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-row.sm {
  align-items: flex-start;
  gap: 10px;
}
.brand-row.sm .view-title { margin-top: 2px; }
.brand-mark {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 0;
  display: block;
  object-fit: contain;
}
.brand-mark.home {
  width: 32px;
  height: 32px;
}
.brand-mark.lg {
  width: 48px;
  height: 48px;
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.35));
}
.brand {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  background: linear-gradient(115deg, #fff 15%, var(--accent) 70%, var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.greet {
  margin: 10px 0 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--muted);
}
.view-title {
  margin: 6px 0 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.device-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 650;
  color: var(--accent2);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.24);
  border-radius: 999px;
}
.device-chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(45, 212, 191, 0.75);
}

/* ── Panels ── */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  backdrop-filter: blur(14px);
}
.hero-panel {
  background:
    linear-gradient(145deg, rgba(45, 212, 191, 0.12), transparent 50%),
    var(--card);
}
.sub-hero {
  padding: 14px 16px 16px;
  background:
    linear-gradient(155deg, rgba(45, 212, 191, 0.14) 0%, transparent 42%),
    linear-gradient(340deg, rgba(56, 189, 248, 0.08), transparent 46%),
    var(--card);
  overflow: hidden;
  position: relative;
}
.sub-hero::before {
  content: "";
  position: absolute;
  inset: auto -20% -40% 40%;
  height: 140px;
  background: radial-gradient(closest-side, rgba(45, 212, 191, 0.12), transparent 70%);
  pointer-events: none;
}
.sub-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}
.sub-hero-identity { min-width: 0; flex: 1; }
.sub-hero-server {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  margin-bottom: 10px;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.sub-hero-server .flag-img.flag-inline {
  width: 22px;
  height: 22px;
}
.sub-hero-name-k {
  display: block;
  margin-top: 2px;
}
.sub-hero-name {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  opacity: 0.88;
}
.sub-hero-badges { margin: 0; justify-content: flex-end; flex-shrink: 0; }
.status-server {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 2px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.status-server .flag-img.flag-inline {
  width: 20px;
  height: 20px;
}
.home-keys-block {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}
.home-keys-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.home-key-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.home-key-chip.is-active {
  border-color: rgba(120, 190, 255, 0.45);
  background: rgba(70, 140, 220, 0.16);
}
.home-key-chip-st {
  font-weight: 500;
  opacity: 0.7;
  font-size: 11px;
}
.home-more-keys {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent, #7dd3fc);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  opacity: 0.95;
}
.home-more-keys:active { opacity: 0.7; }
.sub-status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(45, 212, 191, 0.22);
  background:
    linear-gradient(120deg, rgba(45, 212, 191, 0.16), rgba(14, 24, 40, 0.35) 55%),
    rgba(0, 0, 0, 0.28);
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}
.sub-status-banner[data-state="active"] {
  border-color: rgba(52, 211, 153, 0.35);
  background:
    linear-gradient(120deg, rgba(52, 211, 153, 0.18), rgba(14, 24, 40, 0.3) 60%),
    rgba(0, 0, 0, 0.28);
}
.sub-status-banner[data-state="warn"] {
  border-color: rgba(251, 191, 36, 0.35);
  background:
    linear-gradient(120deg, rgba(251, 191, 36, 0.14), rgba(14, 24, 40, 0.3) 60%),
    rgba(0, 0, 0, 0.28);
}
.sub-status-banner[data-state="bad"] {
  border-color: rgba(251, 113, 133, 0.38);
  background:
    linear-gradient(120deg, rgba(251, 113, 133, 0.16), rgba(14, 24, 40, 0.3) 60%),
    rgba(0, 0, 0, 0.28);
}
.sub-status-value {
  display: block;
  margin-top: 2px;
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.sub-status-banner[data-state="active"] .sub-status-value { color: var(--ok); }
.sub-status-banner[data-state="warn"] .sub-status-value { color: var(--warn); }
.sub-status-banner[data-state="bad"] .sub-status-value { color: var(--danger); }
.sub-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: start;
  position: relative;
  z-index: 1;
}
.sub-meta-cell {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid var(--line);
  min-width: 0;
  height: auto;
  min-height: 0;
}
.sub-meta-cell.wide { grid-column: 1 / -1; }
.sub-meta-cell .traffic-head { margin-bottom: 8px; }
.sub-meta-cell .bar { margin-top: 0; }
@media (min-width: 420px) {
  .sub-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sub-meta-cell.wide { grid-column: auto; }
}
.status-panel {
  background:
    linear-gradient(160deg, rgba(56, 189, 248, 0.1), transparent 45%),
    var(--card);
}
.balance-hero {
  text-align: left;
  background:
    linear-gradient(135deg, rgba(45, 212, 191, 0.14), transparent 55%),
    var(--card);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.balance-hero-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.balance-hero-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 22px;
  color: var(--accent, #2dd4bf);
  background: rgba(45, 212, 191, 0.1);
  border: 1px solid rgba(45, 212, 191, 0.22);
  flex-shrink: 0;
}
.balance-hero-icon svg {
  width: 22px;
  height: 22px;
}
.balance-hero-title {
  margin-top: 2px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  line-height: 1.15;
}
.balance-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.balance-hero .status-sub {
  margin: 0;
}
.support-tg {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  background:
    linear-gradient(135deg, rgba(45, 212, 191, 0.12), transparent 55%),
    var(--card);
}
.support-tg-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.support-tg-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--accent, #2dd4bf);
  background: rgba(45, 212, 191, 0.12);
  border: 1px solid rgba(45, 212, 191, 0.24);
}
.support-tg-copy {
  min-width: 0;
  flex: 1;
}
.support-tg-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.2;
}
.support-tg-sub {
  margin: 3px 0 0;
  font-size: 13px;
  line-height: 1.35;
  color: var(--muted);
}
.support-cta {
  gap: 8px;
  min-height: 44px;
  padding: 10px 14px;
  font-size: 14px;
  box-shadow: none;
}
.support-tg-handle {
  margin: 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.3;
}
.support-chat-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
}
.support-chat-panel > .section-label {
  margin: 0;
}
.support-chat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(42vh, 360px);
  overflow-y: auto;
  padding: 0;
}
.support-chat > .hint {
  margin: 0;
  padding: 2px 0;
}
.support-chat:not(:has(.support-msg)) {
  max-height: none;
}
.support-msg {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
}
.support-msg.user {
  align-self: flex-end;
  background: rgba(45, 212, 191, 0.18);
  border: 1px solid rgba(45, 212, 191, 0.28);
}
.support-msg.admin {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line-strong);
}
.support-msg-meta {
  margin-top: 4px;
  font-size: 11px;
  opacity: 0.65;
}
.support-compose {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
  margin-top: 2px;
}
.support-compose textarea {
  width: 100%;
  min-height: 44px;
  max-height: 96px;
  resize: none;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  line-height: 1.35;
  field-sizing: content;
}
.support-compose textarea:focus {
  outline: none;
  border-color: rgba(45, 212, 191, 0.45);
}
.support-compose .btn {
  min-height: 44px;
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 14px;
  box-shadow: 0 6px 18px rgba(45, 212, 191, 0.18);
  white-space: nowrap;
}
.pay-methods {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.promo-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: 10px 0 4px;
}
.promo-row .btn.tiny {
  flex-shrink: 0;
  min-height: 44px;
  padding: 0 14px;
}
#promoStatus {
  margin: 0 0 8px;
}
#promoStatus.is-ok {
  color: var(--accent);
}
#promoStatus.is-err {
  color: #f07178;
}
.pay-method {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.pay-method:hover {
  background: rgba(45, 212, 191, 0.07);
  border-color: rgba(45, 212, 191, 0.28);
}
.pay-method:active {
  transform: scale(0.99);
}
.pay-method:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.pay-method-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.pay-method-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.pay-ico {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: rgba(45, 212, 191, 0.12);
  border: 1px solid rgba(45, 212, 191, 0.22);
}
.pay-ico--stars {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.22);
}
.pay-ico--crypto {
  color: var(--accent2);
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.22);
}
.pay-ico-svg {
  width: 20px;
  height: 20px;
  display: block;
}
.pay-method .pay-meta {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.pay-method .pay-meta.is-available {
  color: var(--ok);
}
.pay-method .pay-meta.is-soon {
  color: var(--muted);
  opacity: 0.9;
}
.plan-card.is-buyable {
  cursor: pointer;
}
.plan-card.is-buyable:active {
  transform: scale(0.99);
}
.balance-amount {
  margin-top: 8px;
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(120deg, #fff, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.status-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.status-title {
  margin-top: 4px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.status-sub {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}
.status-dot {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 6px rgba(143, 163, 188, 0.12);
}
.status-dot[data-state="active"] {
  background: var(--ok);
  box-shadow: 0 0 0 6px rgba(52, 211, 153, 0.15), 0 0 16px rgba(52, 211, 153, 0.45);
}
.status-dot[data-state="warn"] {
  background: var(--warn);
  box-shadow: 0 0 0 6px rgba(251, 191, 36, 0.14);
}
.status-dot[data-state="bad"] {
  background: var(--danger);
  box-shadow: 0 0 0 6px rgba(251, 113, 133, 0.14);
}
.status-dot[data-state="loading"] {
  background: var(--accent2);
  animation: pulse 1.2s ease infinite;
}
@keyframes pulse {
  50% { opacity: 0.45; transform: scale(0.85); }
}

.snap-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}
.snap {
  padding: 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  min-width: 0;
}
.snap.wide { grid-column: 1 / -1; }
.snap-k {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 5px;
}
.snap-v {
  display: block;
  font-size: 15px;
  font-weight: 700;
}

.quick { display: grid; gap: 10px; margin-top: 4px; }
.desktop-auth-gate {
  display: grid;
  gap: 10px;
  margin: 12px 0 4px;
  padding: 16px 14px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--accent, #3b82f6) 45%, var(--line, #243044));
  background: color-mix(in srgb, var(--accent, #3b82f6) 12%, transparent);
}
.desktop-auth-gate #btnDesktopLogin {
  font-size: 16px;
  font-weight: 800;
  min-height: 48px;
}
.desktop-auth-gate #desktopAuthHint {
  margin: 0;
  color: var(--text, #e8eef8);
  font-size: 13px;
  line-height: 1.45;
}
.stack { display: grid; gap: 8px; }

.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(52, 211, 153, 0.14);
  color: var(--ok);
  border: 1px solid rgba(52, 211, 153, 0.3);
}
.pill.warn, .pill.soft.warn {
  background: rgba(251, 191, 36, 0.12);
  color: var(--warn);
  border-color: rgba(251, 191, 36, 0.3);
}
.pill.bad {
  background: rgba(251, 113, 133, 0.12);
  color: var(--danger);
  border-color: rgba(251, 113, 133, 0.3);
}
.pill.soft {
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent2);
  border-color: rgba(56, 189, 248, 0.28);
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.info-grid.tight-top { margin-top: 16px; }
.info-cell {
  padding: 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid var(--line);
  min-width: 0;
}
.info-cell.wide { grid-column: 1 / -1; }
.info-k {
  display: block;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  font-weight: 700;
}
.info-v {
  display: block;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
}
.info-v.truncate, .truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mono { font-family: var(--mono); font-size: 13px; font-weight: 500; }

.traffic-block { margin-top: 14px; }
.traffic-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}
.traffic-nums {
  font-size: 13px;
  font-weight: 650;
  text-align: right;
}
.bar {
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width 0.4s ease;
}
.bar.warn i { background: linear-gradient(90deg, var(--warn), #f97316); }
.bar.bad i { background: linear-gradient(90deg, var(--danger), #f43f5e); }

.key-box { margin-bottom: 12px; }
.key {
  font-size: 12px;
  line-height: 1.5;
  word-break: break-all;
  color: var(--text);
  background: rgba(0, 0, 0, 0.3);
  border-radius: 14px;
  padding: 12px;
  border: 1px solid var(--line);
}
.qr-wrap {
  margin-top: 16px;
  text-align: center;
}
#qrImg {
  width: min(220px, 68vw);
  border-radius: 14px;
  background: #fff;
  padding: 12px;
}
.empty-illu {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  border-radius: 16px;
  background:
    radial-gradient(circle at 30% 30%, rgba(45, 212, 191, 0.45), transparent 55%),
    rgba(45, 212, 191, 0.12);
  border: 1px solid rgba(45, 212, 191, 0.25);
}

.hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin: 12px 0 0;
}
.hint.tight { margin: 0 0 12px; }
.hint a,
a.mw-link,
#profileLoginLink {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(45, 212, 191, 0.45);
  text-underline-offset: 3px;
}
.hint a:hover,
a.mw-link:hover,
#profileLoginLink:hover {
  color: #5eead4;
  text-decoration-color: rgba(94, 234, 212, 0.7);
}
.hint a:active,
a.mw-link:active,
#profileLoginLink:active {
  color: var(--accent-deep);
}
.hint.tip {
  padding: 12px;
  border-radius: 14px;
  background: rgba(56, 189, 248, 0.07);
  border: 1px solid rgba(56, 189, 248, 0.18);
}

/* Buttons */
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 16px;
  padding: 14px 16px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { opacity: 0.38; cursor: default; }
.btn.wide { width: 100%; }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep) 45%, var(--accent2));
  color: #031018;
  border: none;
  box-shadow: 0 8px 28px rgba(45, 212, 191, 0.22);
}
.btn.ghost {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.import-apps {
  display: grid;
  gap: 8px;
}
.import-btn {
  justify-content: flex-start;
  text-align: left;
  gap: 12px;
  padding-left: 12px;
  padding-right: 14px;
}
.import-btn .app-icon,
.import-btn .import-badge {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  border-radius: 8px;
  flex-shrink: 0;
  overflow: hidden;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  color: #031018;
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.import-btn .app-icon img {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}
/* Letter-badge fallback colors (img onerror) */
.import-btn .app-icon--myway:not(:has(img)) { background: #2dd4bf; color: #031018; }
.import-btn .app-icon--happ:not(:has(img)) { background: #5eead4; }
.import-btn .app-icon--hiddify:not(:has(img)) { background: #a78bfa; color: #12081f; }
.import-btn .app-icon--streisand:not(:has(img)) { background: #38bdf8; }
.import-btn .app-icon--v2box:not(:has(img)) { background: #fbbf24; }
.import-btn .app-icon--v2rayng:not(:has(img)) { background: #34d399; }
.import-btn .app-icon--v2raytun:not(:has(img)) { background: #fb7185; }
.import-btn .import-btn-label {
  flex: 1;
  min-width: 0;
  text-align: left;
}
.import-apps:not([hidden]) {
  display: grid;
}

/* Plans */
.plans { display: grid; gap: 6px; }
.plans--group { margin-bottom: 10px; }
.plan-server-head { margin: 12px 0 4px; }
.plan-server-head:first-child { margin-top: 0; }
.plan-server-head .section-label.tight { margin: 0; font-size: 13px; opacity: 0.9; }
.plan-card {
  display: block;
  width: 100%;
  padding: 10px 12px;
  margin: 0;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: default;
  opacity: 1;
}
.plan-card.is-buyable {
  cursor: pointer;
  opacity: 1;
}
.plan-body { min-width: 0; width: 100%; }
.plan-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.plan-title {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.25;
  min-width: 0;
}
.plan-desc {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.72);
}
.plan-meta {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.3;
  color: var(--muted);
}
.plan-price {
  flex-shrink: 0;
  font-weight: 800;
  font-size: 14px;
  line-height: 1.25;
  text-align: right;
  white-space: nowrap;
}
.plan-price small {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.2;
}
.plan-subsection-note {
  margin: -2px 0 8px;
  font-size: 11px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.58);
}
.traffic-reset-note {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.58);
}
.plan-subsection-label {
  margin: 10px 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.plans--whitelist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.plan-card--whitelist {
  padding: 10px 12px;
  border-radius: 12px;
  overflow: hidden;
  min-width: 0;
}
.plan-body--stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  width: 100%;
}
.plan-body--stack .plan-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
.plan-body--stack .plan-price {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}
.plan-body--stack .plan-hint {
  display: inline-block;
  margin-top: 1px;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}
.plan-body--stack .plan-desc {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.65);
}
@media (max-width: 420px) {
  .plans--whitelist { grid-template-columns: 1fr; }
}

/* FAQ */
.faq {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.2);
  margin-bottom: 8px;
  overflow: hidden;
}
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 14px;
  font-weight: 700;
  font-size: 14px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  float: right;
  color: var(--accent);
  font-weight: 800;
}
.faq[open] summary::after { content: "−"; }
.faq p {
  margin: 0;
  padding: 0 14px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

/* Profile */
.profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 800;
  color: #031018;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  margin-bottom: 12px;
}
.profile-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.profile-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}
.list-panel { padding: 6px; }
.list-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 12px;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 12px;
  text-align: left;
}
.list-row:active { background: rgba(255, 255, 255, 0.04); }
.list-row + .list-row {
  border-top: 1px solid var(--line);
  border-radius: 0;
}
.chev { color: var(--muted); font-size: 20px; font-weight: 400; }

/* Menu FAB + side drawer */
.menu-fab {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top, 0px));
  right: 14px;
  z-index: 55;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: rgba(16, 28, 44, 0.92);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}
.menu-fab svg { width: 20px; height: 20px; fill: currentColor; }
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(2, 6, 12, 0.62);
  backdrop-filter: blur(4px);
}
.drawer-backdrop[hidden] { display: none !important; }
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 70;
  width: min(86vw, 340px);
  height: 100%;
  background: linear-gradient(180deg, #0c1624 0%, #0a121c 100%);
  border-left: 1px solid var(--line);
  transform: translateX(104%);
  transition: transform 0.28s ease;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 14px calc(18px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.drawer.is-open { transform: none; }
.drawer-head {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
}
.drawer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.drawer-brand .brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 0;
}
.drawer-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  justify-self: end;
}
.drawer-profile {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}
.profile-avatar.sm {
  width: 44px;
  height: 44px;
  font-size: 18px;
  margin: 0;
}
.drawer-name { font-weight: 700; font-size: 15px; }
.drawer-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}
.drawer-link {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
  text-align: left;
}
.drawer-link svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  opacity: 0.9;
  flex: 0 0 auto;
}
.drawer-link.is-active {
  background: rgba(45, 212, 191, 0.12);
  color: #dffcf6;
}
.drawer-link[hidden] { display: none !important; }

/* Devices list */
.device-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.device-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}
.device-ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent2);
  flex: 0 0 auto;
}
.device-ico svg { width: 20px; height: 20px; fill: currentColor; }
.device-ico img,
.device-ico .device-app-ico {
  width: 22px;
  height: 22px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}
.device-main { min-width: 0; flex: 1; }
.device-name {
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.device-meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.device-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 6px 2px;
}

/* Tab bar */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 8px 6px calc(8px + var(--safe-b));
  background: rgba(7, 13, 22, 0.92);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(18px);
  max-width: 520px;
  margin: 0 auto;
}
.tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 2px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  border-radius: 12px;
}
.tab svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  opacity: 0.9;
}
.tab.is-active {
  color: var(--accent);
}
.tab.is-active svg { opacity: 1; }

/* Overlay loader */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 8, 14, 0.72);
  backdrop-filter: blur(10px);
  animation: fadeIn 0.25s ease;
}
.overlay[hidden] { display: none !important; }
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.overlay-card {
  width: min(320px, 100%);
  text-align: center;
  padding: 32px 24px;
  border-radius: 24px;
  background: var(--card-solid);
  border: 1px solid var(--line-strong);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  animation: popIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.92) translateY(12px); }
  to { opacity: 1; transform: none; }
}
.orbit {
  position: relative;
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
}
.orbit-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(45, 212, 191, 0.2);
  border-top-color: var(--accent);
  animation: spin 0.85s linear infinite;
}
.orbit-dot {
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 0 20px rgba(45, 212, 191, 0.5);
  animation: pulse 1.1s ease infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.overlay-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.overlay-sub {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

.access-gate { z-index: 90; }
.access-gate-card {
  width: min(360px, 100%);
  text-align: left;
}
.access-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 16px 0 10px;
  font-size: 0.92rem;
}
.access-terms-block {
  margin: 12px 0 8px;
}
.access-terms-label {
  font-size: 0.95rem;
  margin-bottom: 8px;
}
.access-terms-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}
.access-terms-btn {
  font-size: 0.9rem;
  padding: 10px 8px;
  border: 1px solid var(--border, rgba(255,255,255,0.12));
  background: transparent;
  color: var(--text);
}
.access-terms-btn.is-active[data-accepted="1"] {
  border-color: #2ecc71;
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
}
.access-terms-btn.is-active[data-accepted="0"] {
  border-color: #e74c3c;
  background: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
}
.access-actions { margin-top: 14px; }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modal[hidden] { display: none !important; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}
.modal-sheet {
  position: relative;
  width: min(480px, 100%);
  max-height: min(78vh, 640px);
  overflow: auto;
  background: var(--card-solid);
  border: 1px solid var(--line-strong);
  border-radius: 24px 24px 0 0;
  padding: 18px 18px calc(18px + var(--safe-b));
  animation: sheetUp 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes sheetUp {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.modal-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.icon-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 12px;
  font-size: 14px;
  cursor: pointer;
}
.modal-body {
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}
.modal-body p { margin: 0 0 12px; }
.modal-body h3 {
  margin: 16px 0 8px;
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}
.draft-note {
  display: none;
}

.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(var(--tab-h) + var(--safe-b) + 16px);
  max-width: 448px;
  margin: 0 auto;
  background: #0f1a28;
  border: 1px solid var(--line-strong);
  padding: 13px 14px;
  border-radius: 14px;
  text-align: center;
  z-index: 90;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  line-height: 1.4;
  font-size: 14px;
  font-weight: 600;
  animation: toastIn 0.25s ease;
}
.toast[hidden] { display: none !important; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* Admin */
.tabbar.has-admin {
  grid-template-columns: repeat(6, 1fr);
}
.admin-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
.admin-tab {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  border-radius: 12px;
  padding: 10px 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}
.admin-tab.is-active {
  color: #031018;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-color: transparent;
}
.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.field input,
.field select {
  appearance: none;
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #0f1a28;
  color: #e8eef7;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color-scheme: dark;
}
.field select option {
  background: #0f1a28;
  color: #e8eef7;
}
.field input:focus,
.field select:focus {
  outline: none;
  border-color: rgba(45, 212, 191, 0.55);
}

/* Custom select — Telegram WebView-safe (flags + contrast) */
.cselect {
  position: relative;
  width: 100%;
  text-transform: none;
  letter-spacing: 0;
}
.cselect-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(45, 212, 191, 0.35);
  background: #0f1a28;
  color: #e8eef7;
  font-family: inherit;
  font-size: 15px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
  color-scheme: dark;
}
.cselect-trigger:focus {
  outline: none;
  border-color: rgba(45, 212, 191, 0.65);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.12);
}
.cselect-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.cselect-value-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cselect-chevron {
  flex-shrink: 0;
  color: var(--accent);
  font-size: 12px;
  opacity: 0.9;
}
.cselect-menu {
  /* Fixed so list is not clipped by .shell / tabbar overflow */
  position: fixed;
  z-index: 120;
  left: 0;
  top: 0;
  width: min(420px, calc(100vw - 24px));
  max-height: min(280px, calc(100vh - 100px - var(--safe-b, 0px)));
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 6px;
  padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  border-radius: 14px;
  border: 1px solid rgba(45, 212, 191, 0.35);
  background: #0f1a28;
  color: #e8eef7;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}
.cselect-menu[hidden] {
  display: none !important;
}
.cselect-menu.is-up {
  box-shadow: 0 -12px 36px rgba(0, 0, 0, 0.5);
}
.cselect-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #e8eef7;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.cselect-option:hover,
.cselect-option:focus {
  background: rgba(45, 212, 191, 0.12);
  outline: none;
}
.cselect-option[aria-selected="true"] {
  background: rgba(45, 212, 191, 0.18);
  color: #f3fbff;
}
.cselect-flag {
  flex-shrink: 0;
  font-size: 20px;
  line-height: 1;
  width: 1.4em;
  text-align: center;
}
.cselect-text {
  min-width: 0;
}
.cselect-code {
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}
.check-grid {
  display: grid;
  gap: 6px;
  max-height: 180px;
  overflow: auto;
  padding: 8px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line);
}
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 650;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
}
.check-row.compact {
  margin: 0;
  padding: 6px 4px;
  font-size: 13px;
  font-weight: 600;
}
.admin-list { display: grid; gap: 8px; }
.admin-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid var(--line);
}
.admin-item-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.admin-item-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.admin-item-head-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.admin-user-avatar {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 800;
  color: #031018;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
}
.admin-user-avatar.lg {
  width: 48px;
  height: 48px;
  font-size: 18px;
}
.admin-user-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}
.admin-user-avatar.has-photo img {
  display: block;
}
.admin-user-avatar.has-photo .admin-user-avatar-fallback {
  display: none;
}
.user-detail-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.user-detail-head-text {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.user-detail-head-text strong {
  font-size: 16px;
  font-weight: 750;
}
.admin-item-main strong {
  font-size: 14px;
  font-weight: 750;
}
.admin-item-main .muted,
.muted {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  word-break: break-word;
}
.admin-item-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}
.admin-item.is-blocked {
  border-color: rgba(251, 113, 133, 0.35);
  background: rgba(251, 113, 133, 0.06);
}
.admin-item.is-expired {
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.05);
}
.user-blocked-badge {
  display: inline-block;
  margin-top: 2px;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  color: var(--danger);
  background: rgba(251, 113, 133, 0.12);
  border: 1px solid rgba(251, 113, 133, 0.28);
  width: fit-content;
}
.user-expired-badge {
  display: inline-block;
  margin-top: 2px;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.28);
  width: fit-content;
}
.users-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.users-filter.is-active {
  border-color: rgba(96, 165, 250, 0.5);
  background: rgba(59, 130, 246, 0.18);
}
.users-stats {
  margin: 0 0 10px;
  font-variant-numeric: tabular-nums;
}
.users-load-more:disabled {
  opacity: 0.55;
}
.users-bulk-bar {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
}
.users-select-all {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted, #9aa4b2);
}
.users-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.admin-item-check {
  flex-shrink: 0;
  margin-top: 4px;
}
.admin-item.has-check {
  align-items: flex-start;
}
.modal-body textarea {
  width: 100%;
  margin-top: 6px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  font: inherit;
  resize: vertical;
  min-height: 110px;
}
.admin-tpl-servers {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}
.admin-srv-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  color: var(--text);
}
.admin-srv-badge.is-off {
  opacity: 0.45;
}
.admin-srv-badge.is-override {
  border-color: rgba(255, 180, 80, 0.55);
  color: #ffc46b;
}
.admin-srv-badge .flag-img.flag-inline {
  width: 16px;
  height: 16px;
  margin: 0 2px -2px 0;
}
.admin-srv-badge .country-code {
  font-size: 10px;
  font-weight: 700;
}
.admin-tpl-srv-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.admin-tpl-srv-label .flag-img.flag-inline {
  width: 18px;
  height: 18px;
  margin: 0;
}
.admin-tpl-expand {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}
.admin-tpl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--line);
  font-size: 12px;
}
.admin-tpl-row .muted {
  font-size: 11px;
}
.key-pick-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.key-pick {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  cursor: pointer;
  font: inherit;
}
.key-pick.is-active {
  border-color: rgba(120, 190, 255, 0.45);
  background: rgba(70, 140, 220, 0.16);
}
.key-pick-main {
  display: grid;
  gap: 3px;
  min-width: 0;
  flex: 1;
}
.key-pick-server {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
}
.key-pick-mark {
  flex-shrink: 0;
  font-size: 14px;
  opacity: 0.85;
}
.btn.tiny {
  padding: 8px 10px;
  font-size: 12px;
  border-radius: 10px;
  white-space: nowrap;
}
.btn.danger {
  background: rgba(251, 113, 133, 0.14);
  border-color: rgba(251, 113, 133, 0.35);
  color: var(--danger);
}
#btnOpenAdmin span:first-child {
  color: var(--accent);
}
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.user-detail {
  display: grid;
  gap: 14px;
}
.user-sec {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line);
}
.user-sec h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}
.user-kv {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 4px 10px;
  font-size: 13px;
}
.user-kv .k {
  color: var(--muted);
  font-weight: 650;
}
.user-kv .v {
  font-weight: 650;
  word-break: break-word;
}
.user-sec .note {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.28);
  color: #7dd3fc;
}
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.ip-history {
  display: grid;
  gap: 6px;
  margin-top: 4px;
  max-height: 220px;
  overflow: auto;
}
.ip-row {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  font-size: 12px;
}
.ip-row .mono {
  font-weight: 750;
  font-size: 13px;
}
.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}
.btn.tiny.preset {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.28);
}
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.field.tight-field {
  margin-top: 8px;
  margin-bottom: 0;
}
.field.tight-field span {
  font-size: 12px;
}
.field.tight-field input {
  margin-top: 4px;
}
.inbound-grid,
.check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
  padding: 10px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line);
}
.inbound-chip {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  white-space: normal;
  max-width: 100%;
}
.inbound-chip.is-on {
  background: rgba(45, 212, 191, 0.18);
  border-color: rgba(45, 212, 191, 0.55);
  color: #ecfeff;
  box-shadow: inset 0 0 0 1px rgba(45, 212, 191, 0.25);
}
.flag-img {
  display: inline-block;
  width: 20px;
  height: 20px;
  vertical-align: -4px;
  border-radius: 3px;
}
.flag-img.flag-inline {
  width: 18px;
  height: 18px;
  margin: 0 4px -2px 0;
}
.country-code {
  font-weight: 650;
  letter-spacing: 0.02em;
}
.country-name {
  font-weight: 650;
}
.srv-title .flag-img {
  margin-right: 4px;
}
.cselect-flag .flag-img {
  display: block;
  width: 22px;
  height: 22px;
}
.flag-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 8px;
}
.flag-pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 52px;
  padding: 6px 4px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: #e8eef8;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.flag-pick .flag-img {
  width: 24px;
  height: 24px;
  vertical-align: 0;
}
.flag-pick.is-on {
  border-color: rgba(45, 212, 191, 0.55);
  background: rgba(45, 212, 191, 0.14);
  box-shadow: inset 0 0 0 1px rgba(45, 212, 191, 0.22);
}
.flag-pick:active {
  transform: scale(0.97);
}

/* ── Profile identities / login methods ── */
.ident-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.ident-row:last-of-type { border-bottom: none; }
.ident-title {
  font-size: 15px;
  font-weight: 700;
}
.ident-sub {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
}
.ident-actions {
  display: flex;
  flex-shrink: 0;
  gap: 6px;
}
.btn.sm {
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 12px;
}
.btn.danger-soft {
  color: var(--danger);
  border-color: rgba(251, 113, 133, 0.28);
}
.ident-email-form {
  display: grid;
  gap: 8px;
  padding: 4px 0 12px;
}
.ident-email-actions {
  display: flex;
  gap: 8px;
}
.ident-badge {
  display: inline-block;
  margin-left: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.14);
  color: var(--ok);
  vertical-align: middle;
}

