/* NextTool — Shared Panel & Auth Theme (matches nexttool.app) */
:root {
  --bg: #050508;
  --bg2: #0a0a10;
  --bg3: #0f0f18;
  --surface: #0f0f18;
  --card: #12121c;
  --card2: #181824;
  --border: rgba(255, 255, 255, .06);
  --border2: rgba(255, 255, 255, .1);
  --text: #8b95a8;
  --muted: #5c6478;
  --bright: #f0f2f7;
  --accent: #00d4aa;
  --accent2: #38bdf8;
  --blue: #00d4aa;
  --blue2: #38bdf8;
  --cyan: #38bdf8;
  --purple: #a78bfa;
  --green: #22c55e;
  --red: #ef4444;
  --orange: #fb923c;
  --yellow: #f59e0b;
  --grad: linear-gradient(135deg, #00d4aa, #38bdf8);
  --grad-text: linear-gradient(135deg, #00d4aa 0%, #38bdf8 50%, #a78bfa 100%);
  --glow: rgba(0, 212, 170, .15);
  --r: 16px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'DM Sans', 'Sora', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ── Logo ── */
.nt-logo-mark,
.logo-mark,
.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 800;
  color: #050508;
  flex-shrink: 0;
  box-shadow: 0 4px 20px var(--glow);
}

.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  font-size: 12px;
}

.nt-logo {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--bright);
  font-family: 'Sora', sans-serif;
  font-weight: 700;
}

.nt-logo-auth {
  justify-content: center;
  margin-bottom: 32px;
  font-size: 1.2rem;
}

.nt-logo-text,
.logo-name,
.logo-text {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  color: var(--bright);
  letter-spacing: -.02em;
}

.nt-logo-text .grad,
.logo-name span {
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nt-logo-panel {
  text-decoration: none;
  flex-shrink: 0;
  min-height: 36px;
}

.nt-logo-panel .nt-logo-text {
  font-size: 15px;
  white-space: nowrap;
}

/* ── Profile / account panel header ── */
.nt-header {
  position: sticky;
  top: 0;
  z-index: 200;
  border-bottom: 1px solid var(--border2);
  background: rgba(5, 5, 8, .94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nt-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
}

.nt-header-bar {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.nt-header-menu {
  display: inline-flex;
  align-items: stretch;
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--border2);
  border-radius: 10px;
}

.nt-header-menu-left {
  flex: 1;
  min-width: 0;
  justify-content: flex-start;
}

.nt-header-menu-right {
  flex-shrink: 0;
}

.nt-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.nt-lang-switch {
  position: relative;
  flex-shrink: 0;
}

.nt-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--border2);
  cursor: pointer;
  line-height: 1;
  white-space: nowrap;
}

.nt-lang-btn:hover {
  color: var(--bright);
  border-color: rgba(0, 212, 170, .25);
}

.nt-lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 160px;
  max-height: 280px;
  overflow-y: auto;
  background: var(--card, #0f1117);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 4px;
  z-index: 300;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
}

.nt-lang-switch.open .nt-lang-menu {
  display: block;
}

.nt-lang-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}

.nt-lang-item:hover {
  background: rgba(255, 255, 255, .06);
  color: var(--bright);
}

.nt-lang-item.active {
  color: var(--accent);
  background: rgba(0, 212, 170, .08);
}

.nt-lang-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 2px 4px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  background: rgba(255, 255, 255, .06);
}

.nt-auth-lang {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  max-width: 420px;
  margin: 0 auto 12px;
}

.nt-header-menu::-webkit-scrollbar {
  display: none;
}

.nt-header-menu .nt-menu-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid transparent;
  border-right: 1px solid rgba(255, 255, 255, .08);
  transition: color .15s, background .15s, border-color .15s;
}

.nt-header-menu .nt-menu-item:last-child {
  border-right: none;
}

.nt-header-menu .nt-menu-item:hover {
  color: var(--bright);
  background: rgba(255, 255, 255, .06);
}

.nt-header-menu .nt-menu-item.active {
  color: var(--accent);
  border-color: rgba(0, 212, 170, .35);
  background: rgba(0, 212, 170, .08);
}

.nt-header-menu .nt-menu-item.nt-menu-logout:hover {
  color: #f87171;
  background: rgba(239, 68, 68, .1);
  border-color: transparent;
}

.nt-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  background: rgba(239, 68, 68, .18);
  color: #f87171;
}

@media (max-width: 900px) {
  .nt-header-inner {
    flex-wrap: nowrap;
    padding: 10px 16px;
    gap: 10px;
    min-height: 56px;
  }
  .nt-header-bar {
    flex: 1;
    min-width: 0;
    justify-content: flex-end;
    gap: 8px;
  }
  .nt-header-menu-desktop {
    display: none !important;
  }
  .nt-header-actions {
    flex: 0 0 auto;
  }
}

@media (max-width: 640px) {
  .nt-logo-panel .nt-logo-text {
    font-size: 12px;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* ── Panel pages (contact, profile) ── */
.nt-panel-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.nt-panel-page h1 {
  font-family: 'Sora', sans-serif;
  font-size: 1.5rem;
  color: var(--bright);
  line-height: 1.2;
  margin-bottom: 6px;
}

.nt-panel-lead {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 24px;
}

.nt-panel-card {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 20px;
}

.nt-panel-card h2 {
  font-family: 'Sora', sans-serif;
  font-size: 1.05rem;
  margin-bottom: 16px;
  color: var(--bright);
}

.nt-contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.nt-contact-card {
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 20px;
}

.nt-contact-card .icon {
  font-size: 22px;
  display: block;
  margin-bottom: 10px;
}

.nt-contact-card h3 {
  font-family: 'Sora', sans-serif;
  font-size: 15px;
  color: var(--bright);
  margin: 0 0 8px;
}

.nt-contact-card p {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

.nt-contact-card a {
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.nt-form-grid {
  display: grid;
  gap: 14px;
}

.nt-form-row label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

.nt-form-row input,
.nt-form-row textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--border2);
  background: rgba(255, 255, 255, .03);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.nt-form-row textarea {
  min-height: 140px;
  resize: vertical;
}

.nt-form-row input:focus,
.nt-form-row textarea:focus {
  outline: none;
  border-color: rgba(0, 212, 170, .45);
}

.nt-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  background: var(--grad);
  color: #050508;
}

.nt-flash {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 16px;
}

.nt-flash.ok {
  background: rgba(0, 212, 170, .1);
  border: 1px solid rgba(0, 212, 170, .25);
  color: var(--accent);
}

.nt-flash.err {
  background: rgba(239, 68, 68, .1);
  border: 1px solid rgba(239, 68, 68, .25);
  color: #f87171;
}

.nt-profile-head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}

.nt-profile-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(0, 212, 170, .35);
  background: rgba(255, 255, 255, .06);
  flex-shrink: 0;
}

.nt-profile-avatar-fallback {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Sora', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: #050508;
  background: var(--grad);
  flex-shrink: 0;
}

.nt-profile-meta h2 {
  margin: 0 0 4px;
  font-family: 'Sora', sans-serif;
  font-size: 1.2rem;
  color: var(--bright);
}

.nt-profile-meta p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

@media (max-width: 768px) {
  .nt-contact-grid {
    grid-template-columns: 1fr;
  }
  .nt-profile-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ── Auth pages (login, register, verify) ── */
.nt-auth-page {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  position: relative;
  overflow: hidden;
}

.nt-auth-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.nt-auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(64px);
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  animation-duration: 7s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-direction: alternate;
}

.nt-auth-orb-1 {
  width: min(560px, 85vw);
  height: min(560px, 85vw);
  background: rgba(0, 212, 170, .62);
  top: -20%;
  left: -15%;
  animation-name: nt-auth-drift-1;
  animation-delay: 0s;
}

.nt-auth-orb-2 {
  width: min(480px, 75vw);
  height: min(480px, 75vw);
  background: rgba(56, 189, 248, .55);
  bottom: -18%;
  right: -12%;
  animation-name: nt-auth-drift-2;
  animation-delay: -2s;
  animation-duration: 9s;
}

.nt-auth-orb-3 {
  width: min(340px, 58vw);
  height: min(340px, 58vw);
  background: rgba(167, 139, 250, .52);
  top: 38%;
  left: 48%;
  animation-name: nt-auth-drift-3;
  animation-delay: -4s;
  animation-duration: 8s;
}

.nt-auth-grid {
  position: absolute;
  inset: -52px;
  background-image:
    linear-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 45%, black 15%, transparent 75%);
  transform: translate3d(0, 0, 0);
  animation: nt-auth-grid-pan 10s linear infinite;
}

@keyframes nt-auth-drift-1 {
  0%   { transform: translate3d(-12vw, -8vh, 0) scale(.94); opacity: .42; }
  50%  { transform: translate3d(16vw, 10vh, 0) scale(1.18); opacity: .72; }
  100% { transform: translate3d(-8vw, 16vh, 0) scale(.88); opacity: .38; }
}

@keyframes nt-auth-drift-2 {
  0%   { transform: translate3d(14vw, 8vh, 0) scale(1.08); opacity: .38; }
  50%  { transform: translate3d(-18vw, -12vh, 0) scale(.86); opacity: .68; }
  100% { transform: translate3d(10vw, -14vh, 0) scale(1.14); opacity: .4; }
}

@keyframes nt-auth-drift-3 {
  0%   { transform: translate3d(-14vw, 10vh, 0) scale(.9);  opacity: .34; }
  50%  { transform: translate3d(18vw, -10vh, 0) scale(1.12); opacity: .62; }
  100% { transform: translate3d(-16vw, -12vh, 0) scale(1); opacity: .36; }
}

@keyframes nt-auth-grid-pan {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(52px, 52px, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .nt-auth-orb,
  .nt-auth-grid {
    animation: none !important;
  }
}

.nt-auth-page::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 50% 40% at 50% 0%, rgba(0, 212, 170, .06), transparent 70%),
    radial-gradient(ellipse 40% 35% at 100% 100%, rgba(56, 189, 248, .05), transparent 65%);
}

.nt-auth-wrap {
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
  margin: 0 auto;
}

.nt-auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px;
}

.nt-auth-title {
  font-family: 'Sora', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--bright);
  margin-bottom: 8px;
}

.nt-auth-sub {
  font-size: .9rem;
  color: var(--muted);
  margin-bottom: 28px;
}

.nt-auth-sub a { color: var(--accent); text-decoration: none; }
.nt-auth-sub a:hover { text-decoration: underline; }

/* Forms */
.nt-label,
.form-label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.nt-input,
.form-input,
input[type=text], input[type=email], input[type=password], input[type=number], textarea, select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: .9rem;
  color: var(--bright);
  font-family: inherit;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.nt-input:focus,
.form-input:focus,
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 212, 170, .12);
}

.nt-input::placeholder,
.form-input::placeholder { color: var(--muted); }

.nt-form-group,
.form-group { margin-bottom: 16px; }

/* Buttons */
.nt-btn-primary,
.btn-submit,
.btn-save {
  width: 100%;
  padding: 14px;
  background: var(--grad);
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: #050508;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 4px 24px var(--glow);
}

.nt-btn-primary:hover,
.btn-submit:hover,
.btn-save:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(0, 212, 170, .25);
}

.nt-btn-google,
.btn-google,
.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 10px 16px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--bright);
  cursor: pointer;
  text-decoration: none;
  transition: border-color .2s, background .2s, transform .2s;
  margin-bottom: 20px;
  box-sizing: border-box;
}

.btn-google .google-icon,
.btn-google svg,
.google-btn svg,
.nt-btn-google svg {
  width: 20px;
  height: 20px;
  max-width: 20px;
  max-height: 20px;
  flex: 0 0 20px;
  display: block;
}

.nt-btn-google:hover,
.btn-google:hover,
.google-btn:hover {
  border-color: rgba(0, 212, 170, .35);
  background: rgba(0, 212, 170, .05);
}

.nt-divider,
.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.nt-divider::before,
.nt-divider::after,
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.nt-divider span,
.divider span {
  font-size: .8rem;
  color: var(--muted);
  white-space: nowrap;
}

/* Alerts */
.nt-alert,
.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: .875rem;
  margin-bottom: 20px;
}

.alert-error, .nt-alert-error {
  background: rgba(239, 68, 68, .1);
  border: 1px solid rgba(239, 68, 68, .25);
  color: #fca5a5;
}

.alert-success, .nt-alert-success {
  background: rgba(34, 197, 94, .1);
  border: 1px solid rgba(34, 197, 94, .25);
  color: #86efac;
}

.alert-info, .nt-alert-info {
  background: rgba(0, 212, 170, .08);
  border: 1px solid rgba(0, 212, 170, .2);
  color: #6ee7d8;
}

.recaptcha-wrap {
  display: flex;
  justify-content: center;
  margin: 8px 0 16px;
}

.nt-footer-link,
.register-link,
.footer-link {
  text-align: center;
  margin-top: 24px;
  font-size: .9rem;
  color: var(--muted);
}

.nt-footer-link a,
.register-link a,
.footer-link a {
  color: var(--accent);
  text-decoration: none;
}

/* ── Panel overrides (dashboard, admin, seo, etc.) ── */
body { background: var(--bg) !important; }

.topbar,
nav {
  background: var(--surface) !important;
  border-bottom-color: var(--border) !important;
}

.nav a.active {
  color: var(--accent) !important;
  background: rgba(0, 212, 170, .08) !important;
}

.nav a:hover {
  color: var(--bright) !important;
}

.card, .panel-card {
  background: var(--card) !important;
  border-color: var(--border) !important;
}

.tab-btn.active {
  background: var(--card2) !important;
  color: var(--bright) !important;
}

.btn-admin {
  background: rgba(0, 212, 170, .1) !important;
  color: var(--accent) !important;
  border-color: rgba(0, 212, 170, .25) !important;
}

.stat-card, .metric-card, .bot-card {
  border-color: var(--border) !important;
}

a { color: var(--accent2); }

h1, h2, h3, .card-title, .sec-title {
  color: var(--bright);
  font-family: 'Sora', sans-serif;
}

.mono, code, .form-input.mono {
  font-family: 'JetBrains Mono', monospace;
}

@media (max-width: 480px) {
  .nt-auth-card, .card { padding: 24px 18px; border-radius: 18px; }
  .nt-logo-auth { margin-bottom: 20px; }
  .recaptcha-wrap { transform: scale(.85); transform-origin: center; }
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE SYSTEM
   ═══════════════════════════════════════════════════════════════ */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow-x: clip;
  max-width: 100vw;
}

img, video, svg:not(.google-icon) {
  max-width: 100%;
  height: auto;
}

/* Profile header — mobile drawer */
.nt-header-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  border: 1px solid var(--border2);
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  cursor: pointer;
  flex-shrink: 0;
}
.nt-header-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--bright);
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}
.nt-header-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nt-header-toggle.open span:nth-child(2) { opacity: 0; }
.nt-header-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 900px) {
  .nt-header-toggle {
    display: flex;
    margin-left: auto;
  }
}

.nt-header-mobile-menu {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 10px 16px 14px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border2);
}
.nt-header-mobile-menu.open { display: flex; }
.nt-header-mobile-menu .nt-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}
.nt-header-mobile-menu .nt-menu-item.active {
  color: var(--accent);
  background: rgba(0, 212, 170, .08);
}
.nt-header-mobile-sep {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

/* Bot panel topbar (dashboard, seo, ugd) */
.topbar {
  flex-wrap: nowrap;
  padding-left: max(12px, env(safe-area-inset-left));
  padding-right: max(12px, env(safe-area-inset-right));
}
.topbar-right {
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 0;
}
.topbar-right .nt-lang-switch { flex-shrink: 0; }

.mob-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 8px;
  border: 1px solid var(--border2, rgba(255,255,255,.1));
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  cursor: pointer;
  flex-shrink: 0;
}
.mob-menu-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text, var(--bright));
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}
.mob-menu-btn.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.mob-menu-btn.open span:nth-child(2) { opacity: 0; }
.mob-menu-btn.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.mob-nav {
  display: none;
  position: fixed;
  top: 52px;
  left: 0;
  right: 0;
  z-index: 48;
  max-height: min(70vh, 480px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px 14px 14px;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  background: var(--surface, #0d1421);
  border-bottom: 1px solid var(--border, #1a2540);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}
.mob-nav.open { display: flex; flex-direction: column; gap: 3px; }
.mob-nav a {
  padding: 11px 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted, #3d5275);
  text-decoration: none;
  transition: color .15s, background .15s;
}
.mob-nav a:hover { color: var(--text, #a8c0d8); background: rgba(255, 255, 255, .04); }
.mob-nav a.active { color: var(--blue, #4fa3e8); background: rgba(79, 163, 232, .1); }
.mob-nav a.active-seo { color: var(--teal, #10b981); background: rgba(16, 185, 129, .1); }
.mob-nav a.active-ugd { color: var(--ugd, #f59e0b); background: rgba(245, 158, 11, .12); }
.mob-nav-sep { height: 1px; background: var(--border, #1a2540); margin: 4px 0; }
.mob-nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 4px;
  font-size: 12px;
  color: var(--muted, #3d5275);
}

@media (max-width: 860px) {
  .topbar-center { display: none !important; }
  .mob-menu-btn { display: flex; flex-direction: column; gap: 4px; }
  .topbar { height: 52px; gap: 8px; }
  .logo-text { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .user-chip span:not(.lic-dot) { display: none; }
  .btn-sm .btn-label { display: none; }
  .btn-sm .btn-icon { display: inline; }
}

@media (max-width: 600px) {
  .logo-text { display: none; }
  .topbar-right .btn-sm:not(.btn-logout) { padding: 6px 8px; }
}

/* Standalone page navs (buy, checkout, support) */
.nt-page-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
  padding: 12px 16px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}
.nt-page-nav .nav-user {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-left: auto;
  font-size: .85rem;
}
@media (max-width: 640px) {
  .nt-page-nav { padding: 10px 12px; }
  .nt-page-nav .logo-text,
  .nt-page-nav .nav-user > span:first-child { display: none; }
  .nt-page-nav .nav-user { margin-left: auto; font-size: .8rem; }
}

/* Responsive tables */
.nt-table-wrap,
.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -4px;
  padding: 0 4px;
}
.nt-table-wrap table,
.table-scroll table {
  min-width: 520px;
}

/* Profile dashboard (login.nexttool.app/dashboard.php) */
body.nt-panel-dashboard {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.nt-panel-dashboard .profile-wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px max(20px, env(safe-area-inset-right)) 60px max(20px, env(safe-area-inset-left));
  box-sizing: border-box;
}

.nt-panel-dashboard .profile-top {
  margin-bottom: 28px;
}

.nt-panel-dashboard .profile-top h1 {
  font-family: 'Sora', sans-serif;
  font-size: clamp(1.15rem, 4.5vw, 1.5rem);
  color: var(--bright);
  line-height: 1.25;
  word-break: break-word;
}

.nt-panel-dashboard .stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.nt-panel-dashboard .stat-card {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 14px;
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: border-color .2s, transform .2s;
  min-width: 0;
}

.nt-panel-dashboard .stat-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.nt-panel-dashboard .stat-card .num {
  font-family: 'Sora', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--bright);
  line-height: 1;
}

.nt-panel-dashboard .stat-card .lbl {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.35;
}

.nt-panel-dashboard .stat-card .link {
  font-size: 12px;
  color: var(--accent);
  margin-top: 10px;
  display: inline-block;
}

.nt-panel-dashboard .profile-sections {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.nt-panel-dashboard .section {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 20px;
}

.nt-panel-dashboard .section h2 {
  font-family: 'Sora', sans-serif;
  font-size: 1.05rem;
  margin-bottom: 16px;
  color: var(--bright);
}

.nt-panel-dashboard .product-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.nt-panel-dashboard .product-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.nt-panel-dashboard .product-row:first-child {
  padding-top: 0;
}

.nt-panel-dashboard .product-meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.45;
}

.nt-panel-dashboard .btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  background: var(--grad);
  color: #050508;
  white-space: nowrap;
  flex-shrink: 0;
}

.nt-panel-dashboard .btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border2);
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}

.nt-panel-dashboard .empty {
  color: var(--muted);
  font-size: 14px;
  padding: 12px 0;
}

.nt-panel-dashboard table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.nt-panel-dashboard table.data th,
.nt-panel-dashboard table.data td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.nt-panel-dashboard table.data th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
}

body.profile-nav-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  .nt-panel-dashboard .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}

@media (max-width: 768px) {
  .nt-panel-dashboard .profile-wrap {
    padding: 16px max(12px, env(safe-area-inset-right)) 48px max(12px, env(safe-area-inset-left));
  }

  .nt-panel-dashboard .stat-card {
    padding: 16px;
  }

  .nt-panel-dashboard .stat-card .num {
    font-size: 1.5rem;
  }

  .nt-panel-dashboard .section {
    padding: 16px;
  }

  .nt-panel-dashboard .product-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .nt-panel-dashboard .product-row .btn-sm,
  .nt-panel-dashboard .product-row .btn-outline {
    width: 100%;
    justify-content: center;
  }

  .nt-panel-dashboard table.data {
    font-size: 12px;
  }

  .nt-panel-dashboard table.data th,
  .nt-panel-dashboard table.data td {
    padding: 8px 6px;
    white-space: nowrap;
  }

  .nt-header-inner {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
}

@media (max-width: 480px) {
  .nt-panel-dashboard .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .nt-panel-dashboard .stat-card {
    padding: 14px 12px;
  }

  .nt-panel-dashboard .stat-card .num {
    font-size: 1.35rem;
  }

  .nt-panel-dashboard .stat-card .lbl {
    font-size: 12px;
  }
}

/* Panel pages */
@media (max-width: 768px) {
  .nt-panel-page { padding: 16px 14px 48px; }
  .nt-panel-page h1 { font-size: 1.25rem; }
  .nt-panel-card { padding: 16px; }
  .nt-form-grid-2 { grid-template-columns: 1fr !important; }
}

/* Support / buy layout helpers */
@media (max-width: 768px) {
  .container { padding: 0 14px !important; margin: 16px auto !important; }
  .page-head { flex-direction: column; align-items: stretch !important; }
  .page-head .btn { width: 100%; justify-content: center; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .ticket-item { flex-direction: column; align-items: stretch; }
  .msg-bubble { max-width: 100% !important; }
  .topbar .btn-back { margin-left: 0; width: 100%; text-align: center; margin-top: 8px; }
  .topbar:has(.btn-back) { flex-wrap: wrap; }
}

/* Touch-friendly controls */
@media (max-width: 768px) {
  button, .btn, .btn-sm, .btn-primary, .btn-submit, .nt-btn-primary,
  .pay-method label, .nt-menu-item, .mob-nav a {
    min-height: 44px;
  }
  input, select, textarea, .form-input, .nt-input {
    font-size: 16px !important;
  }
}

/* Layout grids used in bot dashboards */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr !important; }
}
@media (max-width: 700px) {
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .form-grid { grid-template-columns: 1fr !important; }
  .counter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

/* Bot dashboard — content areas */
@media (max-width: 768px) {
  .layout {
    padding: 0 10px !important;
    margin: 12px auto !important;
    gap: 12px !important;
  }
  .main-content { min-width: 0; overflow-x: hidden; }
  .box-hdr { flex-wrap: wrap; gap: 8px; }
  .box-hdr .btn, .box-hdr button { flex: 1 1 auto; min-width: 0; }
  .banner, .status-banner { flex-direction: column; align-items: stretch !important; }
  .banner-actions, .status-actions { flex-direction: column; width: 100%; gap: 8px; }
  .banner-actions .btn, .status-actions .btn, .banner-actions a, .status-actions a {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
  .key-box { flex-direction: column; align-items: stretch; gap: 10px; }
  .info-row { flex-direction: column; align-items: flex-start; gap: 4px; }
  .info-val { max-width: 100% !important; text-align: left !important; word-break: break-word; }
  .log-detail { max-width: 100px; }
  .tab-bar, .tabs, .nav-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap !important;
    scrollbar-width: none;
  }
  .tab-bar::-webkit-scrollbar, .tabs::-webkit-scrollbar { display: none; }
  .modal { width: calc(100% - 24px) !important; margin: 12px; }
  .modal-footer { flex-direction: column; }
  .modal-footer .btn { width: 100%; }
  .topbar .btn-back { order: 99; width: 100%; text-align: center; margin-top: 8px; }
}

/* API / telegram standalone pages */
@media (max-width: 768px) {
  .api-grid, .endpoint-grid, .doc-grid {
    grid-template-columns: 1fr !important;
  }
  .code-block, pre, .endpoint-url {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 12px;
  }
}

/* Landing index pricing */
@media (max-width: 768px) {
  .pricing-grid, .features-grid, .hero-actions {
    grid-template-columns: 1fr !important;
  }
  .hero { padding: 48px 16px 32px !important; }
  .hero h1 { font-size: clamp(1.6rem, 7vw, 2.2rem) !important; }
}

/* ── v11: site-wide mobile polish ── */
.page-wrap {
  max-width: 1140px;
  margin-left: auto;
  margin-right: auto;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}
.page-wrap--mt-sm { margin-top: 14px; }
.page-wrap--mt { margin-top: 16px; }
.page-wrap--mt-lg { margin-top: 24px; padding-bottom: 32px; }

.nt-auth-page {
  padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  align-items: center;
  justify-content: center;
}
.nt-auth-wrap { max-width: min(440px, 100%); }
.nt-auth-lang {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 5;
}

@media (min-width: 901px) {
  .nt-auth-page { padding: 32px 24px; }
  .nt-auth-card { box-shadow: 0 24px 80px rgba(0, 0, 0, .45); }
}

@media (max-width: 768px) {
  .page-wrap { padding-left: 12px; padding-right: 12px; }
  .bot-update-inner,
  .maintenance-inner {
    flex-direction: column;
    align-items: stretch !important;
    padding: 12px 14px !important;
    gap: 10px;
    text-align: left;
  }
  .bot-update-badge,
  .maintenance-inner > div:last-child {
    align-self: flex-start;
    white-space: normal !important;
  }
  .bot-update-icon,
  .maintenance-icon { font-size: 22px; }
  .mob-nav {
    max-height: min(72vh, calc(100dvh - 52px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  body.mob-nav-open { overflow: hidden; }
  .topbar {
    padding-left: max(10px, env(safe-area-inset-left)) !important;
    padding-right: max(10px, env(safe-area-inset-right)) !important;
  }
  .nt-lang-menu {
    right: 0;
    left: auto;
    max-width: min(260px, calc(100vw - 20px));
  }
  .nt-auth-card { padding: 28px 20px; }
  .nt-logo-auth .nt-logo-text { font-size: 15px; }
  .sc-value { font-size: 1.35rem !important; }
  .counter-val { font-size: 1.1rem !important; }
  .no-server { padding: 24px 16px; }
}

@media (max-width: 480px) {
  .page-wrap { padding-left: 10px; padding-right: 10px; }
  .nt-auth-title { font-size: 1.35rem; }
  .btn-google, .btn-submit { font-size: .875rem; }
  .btn-google, .google-btn { min-height: 44px; padding: 9px 14px; }
}

/* ── v12: tighter mobile layout for bot dashboards ── */
@media (max-width: 768px) {
  .layout {
    max-width: 100% !important;
    width: 100%;
    padding-left: max(12px, env(safe-area-inset-left)) !important;
    padding-right: max(12px, env(safe-area-inset-right)) !important;
    margin-top: 12px !important;
    margin-bottom: 24px !important;
  }
  .no-server {
    padding: 20px 14px;
    min-height: 0;
  }
  .stat-row {
    gap: 8px;
    margin-bottom: 12px;
  }
  .stat-card {
    padding: 12px 14px;
  }
  .sc-value {
    font-size: 1.25rem !important;
  }
  .page-wrap > div[style*="justify-content:space-between"] {
    flex-direction: column;
    align-items: stretch !important;
  }
  .page-wrap > div[style*="justify-content:space-between"] > div:last-child,
  .page-wrap > div[style*="justify-content:space-between"] a {
    width: 100%;
    text-align: center;
    white-space: normal !important;
  }
}

@media (max-width: 480px) {
  .layout {
    padding-left: max(10px, env(safe-area-inset-left)) !important;
    padding-right: max(10px, env(safe-area-inset-right)) !important;
  }
  .stat-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px;
  }
}
