:root {
  --ink: #10241c;
  --ink-soft: #3d5449;
  --muted: #6f8378;
  --line: rgba(16, 36, 28, 0.1);
  --surface: rgba(255, 255, 255, 0.78);
  --surface-solid: #f7faf8;
  --brand: #147a58;
  --brand-deep: #0c4a36;
  --brand-soft: #dff3ea;
  --accent: #c45c26;
  --danger: #c0392b;
  --ok: #1b8a5a;
  --warn: #b7791f;
  --shadow: 0 18px 50px rgba(16, 36, 28, 0.12);
  --radius: 18px;
  --font-display: "Syne", sans-serif;
  --font-body: "Manrope", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(20, 122, 88, 0.18), transparent 60%),
    radial-gradient(700px 420px at 100% 0%, rgba(196, 92, 38, 0.12), transparent 55%),
    linear-gradient(180deg, #eef5f1 0%, #f8faf8 45%, #eef2f0 100%);
  background-attachment: fixed;
}

a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font: inherit; }

.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 18px;
  background: linear-gradient(180deg, #0d3a2c 0%, #123f31 55%, #0b2c22 100%);
  color: #e8f6ef;
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.05);
  animation: slideIn .55s ease both;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 12px 28px;
}
.brand-logo-wrap {
  display: block;
  width: 100%;
  padding: 2px 4px 20px;
}
.logo-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  background: #0a0a0a;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 12px 10px;
  box-sizing: border-box;
}
.panel-logo {
  display: block;
  width: 100%;
  height: auto;
  background: transparent;
  border: 0;
  padding: 0;
  box-shadow: none;
}
.brand-badge {
  display: block;
  align-self: flex-end;
  margin-top: 8px;
  font-size: .68rem;
  opacity: .75;
  letter-spacing: .16em;
  text-transform: uppercase;
  padding: 0;
  white-space: nowrap;
  color: rgba(232, 246, 239, 0.85);
}
.brand strong {
  font-family: var(--font-display);
  font-size: 1.7rem;
  letter-spacing: -0.03em;
}
.brand span {
  font-size: .75rem;
  opacity: .65;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 6px;
  border-radius: 12px;
  color: rgba(232, 246, 239, 0.78);
  transition: background .2s ease, transform .2s ease, color .2s ease;
}
.nav-icon {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
}
.nav-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}
.nav-link:hover .nav-icon,
.nav-link.active .nav-icon {
  opacity: 1;
}
.nav-link-label { flex: 1; min-width: 0; }
.nav-free-badge {
  flex: 0 0 auto;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 3px 7px;
  border-radius: 999px;
  color: #0c4a36;
  background: linear-gradient(135deg, #b8f0d4 0%, #7ed9b0 100%);
  box-shadow: 0 0 0 1px rgba(184, 240, 212, 0.35);
  line-height: 1.2;
}
.nav-link:hover .nav-free-badge,
.nav-link.active .nav-free-badge {
  background: linear-gradient(135deg, #dff9ec 0%, #9aecc8 100%);
}
.nav-link:hover, .nav-link.active {
  background: rgba(255,255,255,0.1);
  color: #fff;
  transform: translateX(3px);
}

.main {
  padding: 28px clamp(18px, 3vw, 36px) 48px;
  animation: fadeUp .55s ease both;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.topbar h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.topbar p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.3;
}
.topbar-wallet {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  box-shadow: 0 8px 20px rgba(16, 36, 28, 0.06);
  color: var(--ink);
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  flex: 0 0 auto;
}
.topbar-wallet:hover {
  transform: translateY(-1px);
  border-color: rgba(20, 122, 88, 0.28);
  box-shadow: 0 12px 24px rgba(20, 122, 88, 0.12);
  color: var(--ink);
}
.topbar-wallet-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.topbar-wallet strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--brand-deep);
}
.topbar-wallet small {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 16px;
}
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card {
  background: var(--surface);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  animation: fadeUp .6s ease both;
}
.card h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.05rem;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: -0.04em;
  margin: 8px 0 0;
}
.stat-label { color: var(--muted); font-size: .9rem; }
.stat-card { position: relative; overflow: hidden; }
.stat-card::after {
  content: "";
  position: absolute;
  right: -20px; top: -20px;
  width: 90px; height: 90px;
  border-radius: 50%;
  background: var(--brand-soft);
  opacity: .7;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  cursor: pointer;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(20,122,88,.25); }
.btn-secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn-danger { background: var(--danger); }
.btn-ghost { background: transparent; color: var(--ink-soft); border: 1px solid var(--line); }
.btn-sm { padding: 8px 12px; font-size: .88rem; border-radius: 10px; }

.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 6px; font-weight: 600; color: var(--ink-soft); font-size: .9rem; }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: rgba(20,122,88,.45);
  box-shadow: 0 0 0 4px rgba(20,122,88,.12);
}

.table-wrap { overflow: auto; border-radius: 14px; }
table.data {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}
table.data th, table.data td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  font-size: .94rem;
}
table.data th { color: var(--muted); font-weight: 700; font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
  background: var(--brand-soft);
  color: var(--brand-deep);
}
.badge-warn { background: #fff4df; color: #8a5a12; }
.badge-danger { background: #fde8e6; color: #9b2c2c; }

.installer-box {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-top: 14px;
}
.installer-box code {
  flex: 1;
  display: block;
  padding: 14px 16px;
  border-radius: 12px;
  background: #0f241c;
  color: #d7f5e8;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .92rem;
  overflow-x: auto;
  white-space: nowrap;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.auth-page::before {
  content: "";
  position: absolute;
  inset: -20% auto auto -10%;
  width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(20,122,88,.25), transparent 70%);
  animation: float 10s ease-in-out infinite;
}
.auth-page::after {
  content: "";
  position: absolute;
  right: -8%; bottom: -15%;
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(196,92,38,.18), transparent 70%);
  animation: float 12s ease-in-out infinite reverse;
}
.auth-card {
  width: min(440px, 100%);
  position: relative;
  z-index: 1;
  background: rgba(255,255,255,.86);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 36px 30px;
  box-shadow: var(--shadow);
  animation: fadeUp .65s cubic-bezier(.22,1,.36,1) both;
}
.auth-card h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: -0.04em;
}
.auth-card .sub { color: var(--muted); margin: 8px 0 24px; }
.auth-logo {
  display: block;
  max-width: 200px;
  width: 100%;
  height: auto;
  margin: 0 auto 18px;
  background: #0a0a0a;
  border-radius: 14px;
  padding: 14px 18px;
  box-shadow: none;
  border: 1px solid rgba(15, 61, 50, 0.12);
}
.auth-brand {
  font-family: var(--font-display);
  font-size: .85rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 10px;
}

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(10, 24, 18, .45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 50;
  backdrop-filter: blur(4px);
}
.modal-backdrop.open { display: flex; animation: fadeIn .2s ease; }
.modal {
  width: min(480px, 100%);
  background: #fff;
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
  animation: fadeUp .25s ease;
}
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  min-width: 240px;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #10241c;
  color: #fff;
  box-shadow: var(--shadow);
  transform: translateY(20px);
  opacity: 0;
  transition: .25s ease;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.ok { background: #0f3d32; }
.toast.err { background: #7a2218; }

.menu-toggle {
  display: none;
  border: 0;
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
}

.ads-stack {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 16px;
  align-items: start;
}
.ad-card {
  border-left: 4px solid var(--brand);
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.ad-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}
.ad-card p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  flex: 1;
}
.ad-card .btn {
  margin-top: 12px;
  align-self: flex-start;
}
@media (max-width: 640px) {
  .ads-stack {
    grid-template-columns: 1fr;
  }
}

.vip-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #7a4a00;
  background: linear-gradient(135deg, #ffe7a8, #f5c76b);
  vertical-align: middle;
}
.vip-badge::before {
  content: "★";
  font-size: 0.7rem;
}
.license-key-card .license-key-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.license-key-value {
  font-size: 1.15rem !important;
  word-break: break-all;
  cursor: pointer;
  flex: 1;
  min-width: 140px;
}
.license-key-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 0 0 auto;
}
.limit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.limit-row .stat-value { margin: 0; }
.btn-upgrade {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(135deg, #c45c26 0%, #e07a3d 55%, #147a58 140%);
  box-shadow: 0 8px 20px rgba(196, 92, 38, 0.28);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn-upgrade svg {
  width: 15px;
  height: 15px;
  display: block;
}
.btn-upgrade:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 12px 26px rgba(196, 92, 38, 0.34);
  color: #fff;
}
.limit-card .btn-upgrade {
  position: relative;
  z-index: 1;
}

.tools-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 14px;
  align-items: start;
}
.tools-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  position: sticky;
  top: 16px;
}
.tool-tab {
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}
.tool-tab:hover, .tool-tab.active {
  background: var(--brand-soft);
  color: var(--brand-deep);
}
.tool-pane { display: none; }
.tool-pane.active { display: block; animation: fadeUp .3s ease both; }
.tool-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.tool-checks label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--ink-soft);
}
.tool-result {
  background: #0f241c;
  color: #d7f5e8;
  border-radius: 12px;
  padding: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.86rem;
  line-height: 1.55;
  overflow: auto;
}
.tools-panel .field input[readonly],
.tools-panel .field textarea[readonly] {
  background: #f3f7f5;
}

.upgrade-intro {
  color: var(--muted);
  margin: 0 0 16px;
}
.upgrade-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.upgrade-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 20px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.92), rgba(247,250,248,0.88));
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(16, 36, 28, 0.08);
  overflow: hidden;
  animation: fadeUp .55s ease both;
}
.upgrade-card::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand), #2aa876 60%, var(--accent));
}
.upgrade-card.is-unlimited::before {
  background: linear-gradient(90deg, #c9a227, #f0d56a, #147a58);
}
.upgrade-card.is-disabled {
  opacity: 0.62;
  filter: grayscale(0.15);
}
.upgrade-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}
.upgrade-plan-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
}
.upgrade-pill {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  color: #5a3d00;
  background: linear-gradient(135deg, #ffe7a8, #f5c76b);
}
.upgrade-pill-soft {
  color: #0c4a36;
  background: var(--brand-soft);
}
.upgrade-pill-muted {
  color: var(--muted);
  background: #eef2f0;
}
.upgrade-slots {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}
.upgrade-slots-num {
  font-family: var(--font-display);
  font-size: 2.6rem;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--brand-deep);
}
.upgrade-slots-text {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
}
.upgrade-after {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 8px 0 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(20, 122, 88, 0.08);
  border: 1px solid rgba(20, 122, 88, 0.12);
}
.upgrade-after-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
}
.upgrade-after-value {
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.35;
}
.upgrade-after-arrow {
  margin: 0 6px;
  color: var(--muted);
}
.upgrade-after-value strong {
  color: var(--brand-deep);
  font-weight: 800;
}
.upgrade-card.is-disabled .upgrade-after {
  background: #f1f3f2;
  border-color: var(--line);
}
.upgrade-card.is-disabled .upgrade-after-label {
  color: var(--muted);
}
.upgrade-amount {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 10px 0 8px;
}
.upgrade-amount-pay {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.upgrade-amount strong {
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.upgrade-amount-cur {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.9rem;
}
.upgrade-desc {
  color: var(--muted);
  margin: 0 0 16px;
  font-size: 0.92rem;
  line-height: 1.45;
  min-height: 2.6em;
}
.upgrade-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}
.upgrade-actions form { margin: 0; }
.btn-pay-now,
.btn-pay-wallet {
  width: 100%;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  border-radius: 14px;
  padding: 12px 14px;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease, background .18s ease;
}
.btn-pay-now {
  color: #fff;
  background: linear-gradient(135deg, #0f6b4c 0%, #147a58 45%, #1a9a6c 100%);
  box-shadow: 0 10px 22px rgba(20, 122, 88, 0.28);
}
.btn-pay-now:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.05);
}
.btn-pay-wallet {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 4px 12px rgba(16, 36, 28, 0.05);
}
.btn-pay-wallet small {
  font-weight: 600;
  font-size: 0.72rem;
  color: var(--muted);
}
.btn-pay-wallet:hover:not(:disabled) {
  border-color: rgba(20, 122, 88, 0.35);
  background: #f3faf7;
}
.btn-pay-now:disabled,
.btn-pay-wallet:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
.wg-file-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.wg-output .tool-result {
  max-height: 280px;
  overflow: auto;
  margin: 0;
}
.tool-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-bottom: 12px;
}
.tool-checks label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.data-table th,
.data-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.data-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 24, 18, 0.4);
  z-index: 35;
}
.sidebar-backdrop.open { display: block; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: none; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(18px); }
}

@media (max-width: 980px) {
  .grid-4, .grid-2 { grid-template-columns: 1fr 1fr; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(280px, 86vw);
    transform: translateX(-105%);
    transition: transform .25s ease;
    z-index: 40;
    animation: none; /* slideIn fill-mode was forcing transform:none (always open) */
  }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .main { padding: 18px 14px 36px; }
  .topbar { flex-wrap: wrap; }
  .topbar h1 { font-size: 1.2rem; }
  .tools-layout { grid-template-columns: 1fr; }
  .tools-nav { position: static; flex-direction: row; overflow-x: auto; }
  .tool-tab { white-space: nowrap; flex: 0 0 auto; }
}

@media (max-width: 640px) {
  .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .installer-box { flex-direction: column; }
  .installer-box code {
    white-space: normal;
    word-break: break-word;
    font-size: .82rem;
  }
  .stat-value { font-size: 1.55rem; }
  .card { padding: 16px; }
  .auth-card { padding: 28px 20px; }
  .modal { padding: 16px; }
  .toast { left: 12px; right: 12px; min-width: 0; max-width: none; }
  table.data { min-width: 520px; }
  .tools-layout { grid-template-columns: 1fr; }
  .tools-nav {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
  }
  .tool-tab { white-space: nowrap; flex: 0 0 auto; }
}

/* Floating WhatsApp / Telegram support */
.float-support {
  position: fixed;
  right: 18px;
  bottom: 22px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  touch-action: none;
  user-select: none;
  animation: floatBob 3.2s ease-in-out infinite;
}
.float-support.is-dragging {
  animation: none;
  opacity: 0.95;
}
.float-support-handle {
  width: 34px;
  height: 22px;
  border-radius: 999px;
  cursor: grab;
  color: rgba(16, 36, 28, 0.55);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line);
  box-shadow: 0 6px 16px rgba(16, 36, 28, 0.12);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  line-height: 1;
}
.float-support-handle:active { cursor: grabbing; }
.float-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  min-width: 52px;
  height: 52px;
  padding: 0;
  border-radius: 999px;
  color: #fff !important;
  font-weight: 800;
  font-size: 0.88rem;
  box-shadow: 0 12px 28px rgba(16, 36, 28, 0.2);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
  text-decoration: none;
}
.float-btn svg {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  display: block;
}
.float-wa {
  background: linear-gradient(135deg, #1faa59, #25d366 55%, #128c7e);
}
.float-tg {
  background: linear-gradient(135deg, #1d8fd0, #2aa3e0 55%, #229ed9);
}
.float-btn:hover {
  transform: translateY(-2px) scale(1.03);
  filter: brightness(1.05);
  box-shadow: 0 16px 32px rgba(16, 36, 28, 0.26);
}
@keyframes floatBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.upgrade-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 95;
  width: min(420px, calc(100vw - 28px));
  padding: 18px 18px 16px;
  border-radius: 18px;
  background: linear-gradient(160deg, #0f3d30 0%, #145c44 55%, #1a6b4d 100%);
  color: #e8f6ef;
  box-shadow: 0 18px 50px rgba(12, 40, 30, 0.35);
  animation: toastIn .35s ease both;
}
.upgrade-toast.is-hiding {
  animation: toastOut .3s ease forwards;
}
.upgrade-toast-close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: 0;
  background: transparent;
  color: rgba(232, 246, 239, 0.7);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}
.upgrade-toast-eyebrow {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9aecc8;
  margin-bottom: 6px;
}
.upgrade-toast-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1.35;
  margin-bottom: 6px;
  padding-right: 18px;
}
.upgrade-toast-title strong { color: #fff; }
.upgrade-toast-sub {
  margin: 0 0 12px;
  color: rgba(232, 246, 239, 0.72);
  font-size: 0.88rem;
}
.upgrade-toast-sub strong { color: #fff; }
.upgrade-toast-gain {
  display: inline-block;
  margin-left: 4px;
  color: #9aecc8;
  font-weight: 700;
}
.upgrade-toast .btn-upgrade {
  background: linear-gradient(135deg, #f0d56a, #c45c26);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 18px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translate(-50%, 0); }
  to { opacity: 0; transform: translate(-50%, 14px); }
}

@media (max-width: 640px) {
  .float-support { right: 12px; bottom: 14px; }
}

