:root {
  --bg: #070b14;
  --bg-elevated: #0f1629;
  --bg-card: rgba(18, 26, 46, 0.72);
  --border: rgba(148, 163, 184, 0.14);
  --text: #eef2ff;
  --muted: #94a3b8;
  --primary: #3b82f6;
  --primary-glow: rgba(59, 130, 246, 0.35);
  --accent: #22d3ee;
  --success: #34d399;
  --warning: #fbbf24;
  --gradient: linear-gradient(135deg, #3b82f6 0%, #22d3ee 55%, #a78bfa 100%);
  --radius: 18px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --font: "Inter", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

.bg-mesh {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 15% 20%, rgba(59, 130, 246, 0.18), transparent 35%),
    radial-gradient(circle at 85% 10%, rgba(34, 211, 238, 0.12), transparent 30%),
    radial-gradient(circle at 50% 80%, rgba(167, 139, 250, 0.1), transparent 40%);
  z-index: -2;
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, black, transparent 80%);
  z-index: -1;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 5vw;
  backdrop-filter: blur(16px);
  background: rgba(7, 11, 20, 0.72);
  border-bottom: 1px solid var(--border);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.logo-mark {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 12px;
  background: var(--gradient);
  box-shadow: 0 8px 24px var(--primary-glow);
}

.nav-links {
  display: flex;
  gap: 1.4rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.nav-links a:hover,
.nav-app {
  color: var(--text);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: none;
  border-radius: 6px;
  padding: 0.75rem 1.25rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.btn:hover {
  opacity: 0.92;
}

.btn-sm {
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
}

.btn-lg {
  padding: 0.9rem 1.5rem;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
  padding: 0.9rem 1.25rem;
  margin-top: 0.75rem;
}

.btn-primary {
  color: #0a0a0a;
  background: #fff;
}

.btn-secondary {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
}

.btn-ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.btn-outline {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
}

.hero {
  max-width: 920px;
  margin: 0 auto;
  padding: 6rem 5vw 4rem;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  margin-bottom: 1.2rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.85rem;
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  max-width: 680px;
  margin: 0 auto 2rem;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
  margin-bottom: 3rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  max-width: 760px;
  margin: 0 auto;
}

.stat {
  padding: 1rem;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.stat strong {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 0.2rem;
}

.stat span {
  color: var(--muted);
  font-size: 0.88rem;
}

.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 5vw 4rem;
}

.section-head {
  text-align: center;
  margin-bottom: 2rem;
}

.section-head h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  letter-spacing: -0.03em;
}

.section-head p {
  margin: 0;
  color: var(--muted);
}

.cards-grid,
.pricing-grid {
  display: grid;
  gap: 1rem;
}

body.landing .cards-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 900px;
  margin: 0 auto;
}

body.landing .pricing-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 720px;
  margin: 0 auto;
}

.feature-card,
.price-card {
  padding: 1.4rem;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.feature-icon {
  font-size: 1.8rem;
  margin-bottom: 0.8rem;
}

.feature-card h3,
.price-card h3 {
  margin: 0 0 0.6rem;
}

.feature-card p,
.price-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.price-card.featured {
  border-color: rgba(59, 130, 246, 0.45);
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.12), rgba(18, 26, 46, 0.72));
}

.price-value {
  font-size: 2rem;
  font-weight: 800;
  margin: 0.8rem 0 0.25rem;
  letter-spacing: -0.03em;
}

.price-stars {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.price-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.price-list li {
  padding: 0.25rem 0;
}

body.landing .price-cta {
  margin-top: 0.75rem;
}

.trial-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-top: 1.5rem;
  padding: 1.4rem 1.6rem;
  border-radius: var(--radius);
  border: 1px dashed rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.06);
}

.trial-banner .btn {
  flex-shrink: 0;
  margin: 0;
}

.trial-banner h3 {
  margin: 0 0 0.35rem;
}

.trial-banner p {
  margin: 0;
  color: var(--muted);
}

.webapp-preview .preview-card {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  align-items: center;
  padding: 2rem;
  border-radius: calc(var(--radius) + 6px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.check-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 1.4rem;
  color: var(--muted);
}

.check-list li {
  position: relative;
  padding-left: 1.4rem;
  margin: 0.45rem 0;
}

.preview-copy .btn {
  margin-top: 1.25rem;
}

.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--success);
}

.preview-mock {
  display: flex;
  justify-content: center;
}

.mock-window {
  width: min(100%, 320px);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0b1220;
}

.mock-bar {
  display: flex;
  gap: 0.35rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.04);
}

.mock-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.35);
}

.mock-body {
  padding: 1.2rem;
}

.mock-pill {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.18);
  color: #bfdbfe;
  font-size: 0.82rem;
}

.mock-row {
  display: flex;
  justify-content: space-between;
  margin: 0.55rem 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.mock-bar-line {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  margin-bottom: 0.8rem;
}

.mock-bar-line i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--gradient);
}

.mock-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.8rem;
}

.mock-tags em {
  font-style: normal;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  font-size: 0.82rem;
}

.footer {
  padding: 2rem 5vw 3rem;
  text-align: center;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.footer .logo {
  justify-content: center;
  margin-bottom: 0.6rem;
}

.footer a {
  color: var(--accent);
}

/* Web App */
body.webapp {
  background: var(--tg-theme-bg-color, var(--bg));
  color: var(--tg-theme-text-color, var(--text));
}

.app-shell {
  max-width: 520px;
  margin: 0 auto;
  padding: 1rem 1rem 2rem;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.app-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: var(--gradient);
  color: white;
}

.app-title {
  font-weight: 800;
  letter-spacing: -0.02em;
}

.app-sub {
  color: var(--muted);
  font-size: 0.88rem;
}

.lang-toggle {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  font: inherit;
  cursor: pointer;
}

.demo-banner {
  margin-bottom: 0.85rem;
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.25);
  color: #fde68a;
  font-size: 0.85rem;
}

.panel-card {
  margin-bottom: 0.85rem;
  padding: 1rem 1.05rem;
  border-radius: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.panel-title {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tier-card {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.16), rgba(34, 211, 238, 0.08));
}

.tier-badge {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.tier-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.status-dot.active {
  background: var(--success);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.6);
}

.metric + .metric {
  margin-top: 0.9rem;
}

.metric-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.45rem;
  font-size: 0.92rem;
}

.progress {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--gradient);
  width: 0;
  transition: width 0.4s ease;
}

.empty-state {
  color: var(--muted);
  font-size: 0.92rem;
}

.monitor-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.monitor-tags span {
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.14);
  color: #bfdbfe;
  font-size: 0.85rem;
}

.muted {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0.65rem 0 0;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.action-btn {
  padding: 0.85rem 0.7rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.action-btn:active {
  transform: scale(0.98);
}

.plan-cards {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.plan-card {
  padding: 0.85rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.plan-card strong {
  display: block;
  margin-bottom: 0.25rem;
}

.plan-card span {
  color: var(--muted);
  font-size: 0.88rem;
}

.hidden {
  display: none !important;
}

@media (max-width: 860px) {
  .nav-links {
    display: none;
  }

  .webapp-preview .preview-card {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .topbar {
    padding-inline: 1rem;
  }

  .hero {
    padding-top: 4rem;
  }
}

/* Landing: Tarser, minimal style */
body.landing {
  --bg: #0a0a0a;
  --bg-card: #121212;
  --border: rgba(255, 255, 255, 0.1);
  --text: #f2f2f2;
  --muted: #8a8a8a;
  --font: "IBM Plex Sans", system-ui, sans-serif;
  background: var(--bg);
}

body.landing .topbar {
  background: var(--bg);
  backdrop-filter: none;
}

body.landing .logo {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

body.landing .btn {
  border-radius: 6px;
}

body.landing .btn-primary {
  background: #fff;
  color: #0a0a0a;
  box-shadow: none;
}

body.landing .btn-primary:hover {
  background: #e8e8e8;
}

body.landing .btn-outline:hover {
  border-color: rgba(255, 255, 255, 0.28);
}

body.landing .hero {
  text-align: left;
  max-width: 680px;
  padding: 4rem 5vw 3rem;
}

body.landing .hero-label {
  margin: 0 0 1rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

body.landing .hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

body.landing .hero-lead {
  margin-left: 0;
  font-size: 1rem;
  line-height: 1.65;
}

body.landing .hero-actions {
  justify-content: flex-start;
  margin-bottom: 0;
}

body.landing .feature-card,
body.landing .price-card,
body.landing .preview-card,
body.landing .trial-banner {
  border-radius: 8px;
  backdrop-filter: none;
  box-shadow: none;
  background: var(--bg-card);
}

body.landing .feature-num {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

body.landing .price-card.featured {
  border-color: rgba(255, 255, 255, 0.22);
  background: var(--bg-card);
}

body.landing .price-value span {
  font-size: 1rem;
  font-weight: 500;
  color: var(--muted);
}

body.landing .trial-banner {
  border-style: solid;
}

body.landing .check-list li::before {
  content: "";
  width: 4px;
  height: 4px;
  top: 0.65em;
  border-radius: 50%;
  background: var(--muted);
}

body.landing .mock-bar-line i {
  background: #fff;
}

body.landing .mock-pill {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-radius: 4px;
}

body.landing .footer {
  padding: 2.5rem 5vw;
  text-align: left;
}

body.landing .footer-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

body.landing .footer-name {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}

body.landing .footer-brand p {
  margin: 0;
  font-size: 0.9rem;
}

body.landing .footer a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

body.landing .tab-logo-link {
  flex-shrink: 0;
  opacity: 0.75;
  transition: opacity 0.15s ease;
}

body.landing .tab-logo-link:hover {
  opacity: 1;
}

body.landing .tab-logo {
  display: block;
  height: 32px;
  width: auto;
}

@media (max-width: 600px) {
  body.landing .footer-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }

  body.landing .cards-grid,
  body.landing .pricing-grid {
    grid-template-columns: 1fr;
  }
}

/* Web App: Tarser minimal */
body.webapp {
  --bg: #0a0a0a;
  --bg-card: #121212;
  --border: rgba(255, 255, 255, 0.1);
  --text: #f2f2f2;
  --muted: #8a8a8a;
  --font: "IBM Plex Sans", system-ui, sans-serif;
  background: var(--tg-theme-bg-color, var(--bg));
  color: var(--tg-theme-text-color, var(--text));
  font-family: var(--font);
}

body.webapp .app-shell {
  max-width: 480px;
  padding: 1rem 1rem 1.5rem;
}

body.webapp .avatar {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #fff;
  color: #0a0a0a;
  font-weight: 700;
  font-size: 1rem;
}

body.webapp .app-title {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

body.webapp .lang-toggle {
  border-radius: 6px;
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
}

body.webapp .demo-banner {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--muted);
}

body.webapp .panel-card {
  margin-bottom: 0.75rem;
  padding: 1rem 1.1rem;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: none;
}

body.webapp .tier-card {
  background: var(--bg-card);
}

body.webapp .tier-badge {
  font-size: 1.35rem;
  font-weight: 700;
}

body.webapp .panel-title {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

body.webapp .progress i {
  background: #fff;
}

body.webapp .monitor-tags span {
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 0.35rem 0.6rem;
  font-size: 0.82rem;
}

body.webapp .action-btn {
  padding: 0.85rem 0.75rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
}

body.webapp .plan-card {
  border-radius: 6px;
  padding: 0.9rem 1rem;
}

body.webapp .plan-price {
  margin-top: 0.35rem;
  font-size: 1.15rem;
  font-weight: 700;
}

body.webapp .plan-stars {
  margin-top: 0.15rem;
  font-size: 0.88rem;
  color: var(--muted);
}

body.webapp .btn-primary {
  background: #fff;
  color: #0a0a0a;
  border-radius: 6px;
}

body.webapp .app-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  text-align: center;
}

body.webapp .tab-logo {
  height: 28px;
  width: auto;
  opacity: 0.7;
}

body.webapp .tab-logo-link:hover .tab-logo {
  opacity: 1;
}
