:root {
  --bg: #eef7ff;
  --bg2: #f7fbf6;
  --ink: #102033;
  --muted: #6d7a8e;
  --line: rgba(30, 73, 118, .13);
  --card: rgba(255,255,255,.82);
  --accent: #1976f3;
  --accent2: #23b17b;
  --danger: #d94b5a;
  --shadow: 0 22px 70px rgba(42, 88, 130, .18);
  --radius: 28px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Manrope, Nunito Sans, Segoe UI, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 5%, rgba(68, 164, 255, .28), transparent 34rem),
    radial-gradient(circle at 86% 12%, rgba(85, 214, 157, .18), transparent 28rem),
    linear-gradient(145deg, var(--bg), var(--bg2));
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.shell { width: min(1180px, 100%); margin: 0 auto; padding: 22px 18px 112px; }
body.admin-mode .shell { padding-bottom: 28px; }
body.admin-mode {
  background:
    radial-gradient(circle at 14% 2%, rgba(25, 118, 243, .24), transparent 32rem),
    radial-gradient(circle at 92% 10%, rgba(16, 32, 51, .14), transparent 30rem),
    linear-gradient(145deg, #edf5ff, #f7fbff);
}
body.admin-mode .brand-mark {
  background: linear-gradient(145deg, #102033, #1976f3);
  box-shadow: 0 16px 32px rgba(16, 32, 51, .24);
}
body.public-home .hero { display: none; }
body.public-home .shell { padding-top: 28px; }
.hero { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; }
.brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 48px; height: 48px; border-radius: 18px; display: grid; place-items: center; color: white; font-weight: 900; background: linear-gradient(145deg, #0f6cf4, #29c489); box-shadow: 0 16px 28px rgba(25, 118, 243, .26); }
.brand b { display: block; font-size: 19px; letter-spacing: -.03em; }
.brand small { display: block; color: var(--muted); margin-top: 2px; }
.top-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.app { display: grid; gap: 18px; }
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; }
.span-12 { grid-column: span 12; }
.span-8 { grid-column: span 8; }
.span-6 { grid-column: span 6; }
.span-4 { grid-column: span 4; }
.span-3 { grid-column: span 3; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  backdrop-filter: blur(18px);
}
.kicker { color: var(--accent); font-weight: 850; letter-spacing: .08em; text-transform: uppercase; font-size: 12px; }
h1, h2, h3 { margin: 0; letter-spacing: -.05em; line-height: .98; }
h1 { font-size: clamp(42px, 9vw, 88px); max-width: 850px; }
h2 { font-size: clamp(28px, 6vw, 48px); }
h3 { font-size: 22px; }
p { color: var(--muted); line-height: 1.55; margin: 10px 0 0; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.stack { display: grid; gap: 12px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.actions.login-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}
.actions.login-actions .btn { width: 100%; }
.btn {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  border-radius: 18px;
  min-height: 48px;
  padding: 0 18px;
  font-weight: 850;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(34, 83, 126, .14); }
.btn:disabled { cursor: not-allowed; opacity: .62; transform: none; box-shadow: none; }
.btn.primary { background: linear-gradient(135deg, #1678ff, #20b982); color: white; border-color: transparent; }
.btn.ghost { background: rgba(255,255,255,.52); }
.btn.danger { color: var(--danger); }
.btn.block { width: 100%; }
.btn.icon { width: 50px; padding: 0; border-radius: 18px; font-size: 20px; }
.btn.telegram-login {
  background: linear-gradient(135deg, #2aabee 0%, #1689d6 100%);
  border-color: rgba(42, 171, 238, .35);
  color: #fff;
  box-shadow: 0 14px 30px rgba(42, 171, 238, .22);
}
.btn.telegram-login:hover {
  background: linear-gradient(135deg, #34b8ff 0%, #0f80cf 100%);
  box-shadow: 0 18px 36px rgba(42, 171, 238, .28);
}
.tg-btn-icon {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  fill: currentColor;
  margin-left: -2px;
}
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border: 1px solid var(--line); background: rgba(255,255,255,.62); border-radius: 999px; color: var(--muted); font-weight: 800; }
.pill.good { color: #147b54; background: rgba(35,177,123,.12); border-color: rgba(35,177,123,.26); }
.pill.bad { color: var(--danger); background: rgba(217,75,90,.10); border-color: rgba(217,75,90,.22); }
.metric { padding: 18px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.56); }
.metric small { display: block; color: var(--muted); margin-bottom: 8px; }
.metric b { display: block; font-size: 24px; letter-spacing: -.04em; overflow-wrap: anywhere; }
.home-hero { overflow: hidden; position: relative; }
.public-hero {
  min-height: 420px;
  display: grid;
  align-content: center;
  overflow: hidden;
  position: relative;
}
.public-hero::before {
  content: "K";
  position: absolute;
  right: clamp(18px, 8vw, 90px);
  bottom: -34px;
  font-size: clamp(150px, 24vw, 310px);
  line-height: .8;
  font-weight: 950;
  letter-spacing: -.12em;
  color: rgba(25,118,243,.08);
  pointer-events: none;
}
.public-hero.compact { min-height: 260px; }
.landing-hero { min-height: 560px; align-content: stretch; }
.landing-nav {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 34px;
}
.landing-nav a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.58);
  color: var(--muted);
  font-weight: 850;
}
.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 390px);
  gap: 24px;
  align-items: end;
}
.hero-copy p { max-width: 760px; font-size: 17px; }
.hero-panel {
  border: 1px solid rgba(25,118,243,.18);
  border-radius: 28px;
  padding: 22px;
  background:
    radial-gradient(circle at 0 0, rgba(35,177,123,.18), transparent 16rem),
    rgba(255,255,255,.52);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45);
}
.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.trust-strip span,
.tariff-days {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(16,32,51,.07);
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}
.feature-card { position: relative; overflow: hidden; }
.feature-card::after {
  content: "";
  position: absolute;
  inset: auto -40px -70px auto;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(25,118,243,.12), transparent 70%);
}
.feature-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, #1976f3, #23b17b);
  color: #fff;
  font-weight: 950;
  margin-bottom: 18px;
}
.mini-note {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(25,118,243,.16);
  border-radius: 18px;
  background: rgba(25,118,243,.07);
}
.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.faq-item {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  background: rgba(255,255,255,.50);
}
.faq-item h3 { font-size: 19px; }
.footer-legal { display: grid; gap: 16px; }
.public-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.public-links a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.54);
  color: var(--muted);
  font-weight: 850;
}
.public-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.public-facts div {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  background: rgba(255,255,255,.52);
  min-width: 0;
}
.public-facts small {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}
.public-facts b { overflow-wrap: anywhere; }
.public-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.public-list p {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.46);
}
.apps-hero {
  overflow: hidden;
  position: relative;
}
.apps-hero::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: -80px;
  top: -120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(35,177,123,.16), transparent 68%);
  pointer-events: none;
}
.apps-catalog-card { padding: 22px; }
.apps-catalog-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.apps-catalog-head > div {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255,255,255,.72), rgba(236,247,255,.62));
  padding: 14px 16px;
}
.apps-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.app-choice-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0, rgba(25,118,243,.08), transparent 13rem),
    linear-gradient(180deg, rgba(255,255,255,.82), rgba(255,255,255,.66));
  padding: 20px;
  display: grid;
  gap: 16px;
  min-width: 0;
  align-content: start;
  box-shadow: 0 14px 38px rgba(30, 73, 118, .08);
}
.app-choice-card.featured {
  border-color: rgba(35,177,123,.28);
  background:
    radial-gradient(circle at 98% 0, rgba(35,177,123,.14), transparent 13rem),
    linear-gradient(180deg, rgba(255,255,255,.90), rgba(247,252,255,.72));
}
.app-choice-card.mobile {
  border-color: rgba(25,118,243,.22);
  background:
    radial-gradient(circle at 100% 0, rgba(25,118,243,.13), transparent 13rem),
    linear-gradient(180deg, rgba(255,255,255,.88), rgba(246,251,255,.72));
}
.app-choice-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.app-choice-title {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.app-logo {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.7);
  box-shadow: 0 16px 34px rgba(25,118,243,.18);
  overflow: hidden;
}
.app-logo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}
.app-logo.happ {
  background: #2d2d2d;
}
.app-logo.v2raytun {
  background: #050505;
}
.app-logo.hiddify {
  background: #f2f4ff;
}
.app-logo.v2rayn {
  background: #e8f8ff;
}
.app-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(25,118,243,.10);
  color: var(--accent);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .08em;
  margin-bottom: 8px;
}
.app-choice-card h3 { margin: 0; }
.app-choice-card p { margin: 0; color: var(--muted); line-height: 1.58; }
.platform-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.platform-link {
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.72);
  --platform-brand: #1976f3;
  --platform-soft: rgba(25,118,243,.10);
  color: var(--ink);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  min-width: 0;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}
.platform-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--platform-soft);
  color: var(--platform-brand);
}
.platform-glyph {
  width: 22px;
  height: 22px;
  display: block;
  background: currentColor;
  -webkit-mask: var(--platform-icon) center / contain no-repeat;
  mask: var(--platform-icon) center / contain no-repeat;
}
.platform-link.play { --platform-brand: #01875f; --platform-soft: rgba(1,135,95,.12); border-color: rgba(1,135,95,.18); }
.platform-link.apple { --platform-brand: #0a84ff; --platform-soft: rgba(10,132,255,.12); border-color: rgba(10,132,255,.16); }
.platform-link.windows { --platform-brand: #0078d4; --platform-soft: rgba(0,120,212,.12); border-color: rgba(0,120,212,.16); }
.platform-link.github { --platform-brand: #24292f; --platform-soft: rgba(36,41,47,.10); border-color: rgba(36,41,47,.14); }
.platform-link.web { --platform-brand: #17a673; --platform-soft: rgba(23,166,115,.12); border-color: rgba(23,166,115,.16); }
.platform-link.docs { --platform-brand: #8ca1af; --platform-soft: rgba(140,161,175,.14); border-color: rgba(140,161,175,.18); }
.platform-text {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.platform-text small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.platform-text b { overflow-wrap: anywhere; }
.platform-link.primary {
  color: white;
  border-color: transparent;
  background: linear-gradient(135deg, #1976f3, #20b894);
  box-shadow: 0 14px 26px rgba(25,118,243,.18);
}
.platform-link.primary.play {
  background: linear-gradient(135deg, #01875f, #24c46f);
  box-shadow: 0 14px 26px rgba(1,135,95,.20);
}
.platform-link.primary.apple {
  background: linear-gradient(135deg, #007aff, #62b3ff);
  box-shadow: 0 14px 26px rgba(0,122,255,.20);
}
.platform-link.primary.windows {
  background: linear-gradient(135deg, #0078d4, #2aa8ff);
  box-shadow: 0 14px 26px rgba(0,120,212,.20);
}
.platform-link.primary .platform-icon { background: rgba(255,255,255,.92); color: var(--platform-brand); }
.platform-link.primary .platform-text small { color: rgba(255,255,255,.78); }
.platform-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(15,37,63,.10);
  border-color: rgba(25,118,243,.22);
}
.app-note {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(25,118,243,.08);
  color: var(--muted);
}
.steps-list {
  margin: 16px 0 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.72;
}
.steps-list li + li { margin-top: 8px; }
.apps-guide-card,
.apps-shot-card { min-width: 0; }
.apps-shot-card p { color: var(--muted); line-height: 1.58; }
.screenshot-placeholder {
  margin-top: 14px;
  min-height: 180px;
  border: 1px dashed rgba(88,112,139,.45);
  border-radius: 22px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  background: linear-gradient(135deg, rgba(25,118,243,.08), rgba(35,177,123,.08));
  padding: 18px;
}
.legal-doc { display: grid; gap: 14px; }
.legal-doc h3 { margin: 10px 0 0; font-size: 18px; }
.legal-doc h3:first-child { margin-top: 0; }
.legal-doc p { margin: 0; line-height: 1.68; }
.home-hero::after {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  right: -120px;
  top: -160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(35,177,123,.18), transparent 68%);
  pointer-events: none;
}
.home-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 18px;
}
.home-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}
.home-steps div {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
  background: rgba(255,255,255,.48);
  display: grid;
  gap: 6px;
}
.home-steps b {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: white;
  background: linear-gradient(145deg, #1976f3, #23b17b);
}
.home-steps span { font-weight: 900; }
.home-steps small { color: var(--muted); line-height: 1.45; }
.tariff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.tariff-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
  background: rgba(255,255,255,.56);
  display: grid;
  gap: 14px;
  min-width: 0;
}
.tariff-card h3 { margin-top: 12px; }
.tariff-days { margin-left: auto; }
.tariff-price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tariff-price b { font-size: 28px; letter-spacing: -.05em; }
.tariff-old { color: var(--muted); text-decoration: line-through; font-weight: 800; }
.tariff-meta { color: var(--muted); font-size: 14px; line-height: 1.45; }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line); background: rgba(255,255,255,.82); color: var(--ink); border-radius: 18px; min-height: 52px; padding: 14px 16px; outline: none;
}
.textarea { min-height: 108px; resize: vertical; }
.label { display: grid; gap: 7px; font-weight: 800; color: var(--ink); }
.label small { color: var(--muted); font-weight: 700; }
.form { display: grid; gap: 13px; }
.notice { border-radius: 20px; padding: 16px; background: rgba(25,118,243,.09); border: 1px solid rgba(25,118,243,.18); color: #184f95; }
.list { display: grid; gap: 10px; }
.item { border: 1px solid var(--line); background: rgba(255,255,255,.58); border-radius: 20px; padding: 16px; display: flex; justify-content: space-between; gap: 14px; align-items: center; }
.item-main { min-width: 0; }
.item-main b { display: block; overflow-wrap: anywhere; }
.item-main small { color: var(--muted); display: block; margin-top: 4px; }
.route-choice { width: 100%; text-align: left; border: 1px solid var(--line); background: rgba(255,255,255,.62); border-radius: 22px; padding: 16px; display: flex; justify-content: space-between; gap: 14px; align-items: center; }
.route-choice.active { border-color: rgba(25,118,243,.55); box-shadow: inset 0 0 0 1px rgba(25,118,243,.28); background: rgba(25,118,243,.08); }
.route-main { display: flex; align-items: center; gap: 13px; min-width: 0; }
.route-flag { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 14px; background: rgba(255,255,255,.64); font-size: 25px; line-height: 1; box-shadow: inset 0 0 0 1px var(--line); }
.route-text { display: grid; gap: 3px; min-width: 0; }
.route-text b { display: block; overflow-wrap: anywhere; }
.route-text small { display: block; color: var(--muted); overflow-wrap: anywhere; }
.route-check { width: 26px; flex: 0 0 auto; color: var(--accent); text-align: center; font-weight: 900; font-size: 20px; }
.flag { font-size: 28px; line-height: 1; }
.modal-backdrop { position: fixed; inset: 0; z-index: 30; display: grid; place-items: end center; padding: 18px; background: rgba(7, 18, 31, .35); backdrop-filter: blur(10px); }
.modal { width: min(560px, 100%); max-height: min(760px, 92vh); overflow: auto; background: #fbfdff; border: 1px solid var(--line); border-radius: 30px; box-shadow: 0 30px 90px rgba(0,0,0,.22); padding: 22px; }
.support-card { display: grid; gap: 16px; min-height: min(720px, calc(100dvh - 220px)); }
.support-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.support-head p { margin: 8px 0 0; color: var(--muted); line-height: 1.55; max-width: 720px; }
.support-head-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.support-quick { display: flex; flex-wrap: wrap; gap: 10px; }
.support-quick .btn { min-height: 42px; padding: 10px 14px; }
.chat,
.support-chat {
  display: grid;
  gap: 12px;
  min-height: 320px;
  max-height: min(58dvh, 620px);
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,.38);
  align-content: start;
}
.support-empty {
  display: grid;
  gap: 6px;
  place-items: center;
  min-height: 220px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed rgba(30, 73, 118, .18);
  border-radius: 20px;
  background: rgba(255,255,255,.42);
}
.support-empty b { color: var(--ink); font-size: 18px; }
.msg {
  max-width: min(82%, 720px);
  padding: 14px 16px;
  border-radius: 22px;
  background: rgba(255,255,255,.82);
  border: 1px solid var(--line);
  line-height: 1.55;
  white-space: normal;
  overflow-wrap: anywhere;
  box-shadow: 0 10px 26px rgba(41, 86, 126, .08);
}
.msg.user { justify-self: end; background: rgba(25,118,243,.12); border-bottom-right-radius: 8px; }
.msg.ai, .msg.support { justify-self: start; background: rgba(35,177,123,.12); border-bottom-left-radius: 8px; }
.msg.admin { justify-self: start; background: rgba(255,210,90,.18); border-bottom-left-radius: 8px; }
.msg small { display: block; color: var(--muted); margin-bottom: 5px; font-weight: 850; }
.msg-text a { color: var(--accent); font-weight: 850; text-decoration: underline; text-underline-offset: 3px; word-break: break-all; }
.support-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; }
.support-form .textarea { min-height: 92px; }
[hidden] { display: none !important; }
.tabs { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 20; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 8px; background: rgba(255,255,255,.84); border: 1px solid var(--line); border-radius: 25px; box-shadow: 0 18px 48px rgba(38, 88, 132, .22); backdrop-filter: blur(16px); }
.tabs[hidden],
body.loading-mode .tabs {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
body.loading-mode {
  overflow: hidden;
}
body.loading-mode .shell {
  min-height: 100dvh;
  padding-bottom: 0;
  display: grid;
  align-content: center;
}
body.loading-mode .hero,
body.loading-mode .top-actions,
body.loading-mode .toast {
  display: none !important;
}
body.loading-mode .app {
  min-height: calc(100dvh - 40px);
  display: grid;
  place-items: center;
}
body.loading-mode .loading-window {
  width: min(360px, calc(100vw - 44px));
  max-width: none;
  margin: 0 auto;
  padding: 34px 24px 32px;
  border-radius: 30px;
}
body.admin-mode .tabs { display: none !important; }
body.guest-mode .tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tab { border: 0; background: transparent; border-radius: 18px; min-height: 54px; color: var(--muted); font-weight: 850; }
.tab.active { background: var(--ink); color: white; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 94px; transform: translateX(-50%); background: var(--ink); color: white; padding: 13px 16px; border-radius: 18px; box-shadow: 0 16px 45px rgba(0,0,0,.24); max-width: min(92vw, 520px); }
.copy-dialog {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(8, 20, 35, .42);
  backdrop-filter: blur(10px);
}
.copy-dialog-card {
  width: min(92vw, 680px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 22px;
}
.copy-dialog-card p { color: var(--muted); line-height: 1.55; margin: 10px 0 14px; }
.copy-dialog-card textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  margin-bottom: 14px;
  font: 600 13px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-all;
}
.skeleton { width: 100%; height: 34px; border-radius: 999px; background: linear-gradient(90deg, rgba(255,255,255,.38), rgba(255,255,255,.86), rgba(255,255,255,.38)); background-size: 200% 100%; animation: shimmer 1.1s linear infinite; }
.skeleton.short { width: 62%; margin-top: 12px; }
.loading-window { max-width: 560px; margin: clamp(72px, 18vh, 150px) auto 0; text-align: center; padding: 38px 28px 36px; }
.loading-window h2 { margin: 10px 0 8px; }
.loading-window p { max-width: 480px; margin-left: auto; margin-right: auto; }
.app-redirect-card { max-width: 620px; margin: clamp(54px, 15vh, 130px) auto 0; padding: 28px; display: grid; gap: 20px; }
.app-redirect-card .app-choice-title { align-items: flex-start; }
.app-redirect-card h2 { margin: 3px 0 8px; }
.app-redirect-card p { margin: 0; color: var(--muted); }
.app-redirect-card .actions { margin-top: 0; }
.vpn-loader { position: relative; width: 136px; height: 136px; margin: 0 auto 18px; display: grid; place-items: center; }
.vpn-loader.compact { width: 86px; height: 86px; margin: 4px auto; }
.vpn-loader.compact .vpn-loader-core { width: 52px; height: 52px; border-radius: 18px; }
.vpn-loader.compact .vpn-loader-keyhole { width: 19px; height: 19px; border-width: 4px; }
.vpn-loader.compact .vpn-loader-keyhole::after { top: 12px; width: 8px; height: 17px; }
.vpn-loader-core { position: relative; z-index: 2; width: 82px; height: 82px; border-radius: 26px; display: grid; place-items: center; background: linear-gradient(145deg, #0f6cf4, #20bfa7); box-shadow: 0 18px 36px rgba(18, 117, 213, .28); animation: loader-float 2.4s ease-in-out infinite; }
.vpn-loader-keyhole { position: relative; width: 28px; height: 28px; border: 5px solid #fff; border-radius: 50%; box-sizing: border-box; }
.vpn-loader-keyhole::after { content: ""; position: absolute; left: 50%; top: 18px; width: 12px; height: 25px; border-radius: 10px; background: #fff; transform: translateX(-50%); }
.vpn-loader-ring { position: absolute; inset: 8px; border: 1px solid rgba(25, 118, 243, .18); border-top-color: rgba(32, 191, 167, .9); border-right-color: rgba(25, 118, 243, .55); border-radius: 50%; animation: loader-spin 1.35s linear infinite; }
.vpn-loader-ring.ring-b { inset: 20px; border-top-color: rgba(15, 108, 244, .9); border-right-color: rgba(32, 191, 167, .46); animation-duration: 2.1s; animation-direction: reverse; }
.vpn-loader-route { position: absolute; left: 16px; right: 16px; bottom: 8px; display: grid; grid-template-columns: 10px 1fr 10px 1fr 10px; align-items: center; gap: 6px; }
.vpn-loader-route span { width: 10px; height: 10px; border-radius: 50%; background: #20bfa7; box-shadow: 0 0 0 4px rgba(32, 191, 167, .14); animation: route-pulse 1.4s ease-in-out infinite; }
.vpn-loader-route span:nth-child(3) { animation-delay: .18s; background: #0f6cf4; box-shadow: 0 0 0 4px rgba(15, 108, 244, .14); }
.vpn-loader-route span:nth-child(5) { animation-delay: .36s; }
.vpn-loader-route i { height: 2px; border-radius: 999px; background: linear-gradient(90deg, rgba(15, 108, 244, .18), rgba(32, 191, 167, .86), rgba(15, 108, 244, .18)); background-size: 220% 100%; animation: route-line 1.1s linear infinite; }
.loading-status { display: inline-flex; align-items: center; justify-content: center; gap: 10px; margin-top: 16px; padding: 10px 14px; border: 1px solid rgba(25, 118, 243, .16); border-radius: 999px; color: var(--muted); font-size: 14px; font-weight: 760; background: rgba(255,255,255,.62); }
.loading-status span { width: 8px; height: 8px; border-radius: 50%; background: #20bfa7; box-shadow: 0 0 0 0 rgba(32, 191, 167, .38); animation: status-dot 1.25s ease-out infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes loader-spin { to { transform: rotate(360deg); } }
@keyframes loader-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes route-line { to { background-position: -220% 0; } }
@keyframes route-pulse { 0%, 100% { transform: scale(1); opacity: .72; } 50% { transform: scale(1.18); opacity: 1; } }
@keyframes status-dot { 0% { box-shadow: 0 0 0 0 rgba(32, 191, 167, .38); } 100% { box-shadow: 0 0 0 12px rgba(32, 191, 167, 0); } }
@media (max-width: 820px) {
  .shell { padding: 16px 12px 104px; }
  .hero { align-items: flex-start; }
  .brand small { display: none; }
  .top-actions .hide-mobile { display: none; }
  .grid { grid-template-columns: 1fr; }
  .span-8, .span-6, .span-4, .span-3, .span-12 { grid-column: span 1; }
  .apps-grid, .apps-catalog-head, .platform-grid { grid-template-columns: 1fr; }
  .card { padding: 20px; border-radius: 24px; }
  .between { align-items: stretch; flex-direction: column; }
  .landing-hero { min-height: auto; }
  .landing-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 22px; }
  .landing-nav a { justify-content: center; }
  .hero-grid { grid-template-columns: 1fr; align-items: start; }
  .hero-panel { padding: 18px; border-radius: 22px; }
  .home-steps { grid-template-columns: 1fr; }
  .faq-grid { grid-template-columns: 1fr; }
  .item { align-items: stretch; flex-direction: column; }
  .support-card { min-height: calc(100dvh - 170px); padding-bottom: 18px; }
  .support-head { flex-direction: column; }
  .support-head-actions { width: 100%; align-items: stretch; flex-direction: column; }
  .support-quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .support-chat { min-height: 300px; max-height: 46dvh; padding: 10px; border-radius: 22px; }
  .msg { max-width: 94%; padding: 12px 13px; font-size: 15px; }
  .support-form { grid-template-columns: 1fr; }
  .support-form .textarea { min-height: 112px; }
  .btn { width: 100%; }
  .btn.icon { width: 50px; }
  .top-actions .btn { width: auto; }
}
@media (max-width: 460px) {
  .support-quick { grid-template-columns: 1fr; }
}
body.tg { background: #f3f7fb; }
body.tg .hero { padding-top: max(8px, env(safe-area-inset-top)); }
body.tg .brand-mark { width: 42px; height: 42px; }

body[data-theme="dark"] {
  --bg: #07111f;
  --bg2: #0d1b2d;
  --ink: #f3f8ff;
  --muted: #b5c3d6;
  --line: rgba(221, 236, 255, .16);
  --card: rgba(14, 27, 43, .88);
  --shadow: 0 24px 72px rgba(0,0,0,.34);
  background:
    radial-gradient(circle at 16% 0, rgba(35, 130, 255, .18), transparent 34rem),
    radial-gradient(circle at 88% 12%, rgba(35, 177, 123, .13), transparent 30rem),
    linear-gradient(145deg, var(--bg), var(--bg2));
}
body[data-theme="dark"] .btn,
body[data-theme="dark"] .input,
body[data-theme="dark"] .select,
body[data-theme="dark"] .textarea,
body[data-theme="dark"] .item,
body[data-theme="dark"] .metric,
body[data-theme="dark"] .route-choice,
body[data-theme="dark"] .tabs {
  background: rgba(18, 29, 45, .72);
  color: var(--ink);
}
body[data-theme="dark"] .card {
  background: linear-gradient(180deg, rgba(16, 30, 48, .94), rgba(12, 24, 39, .90));
  border-color: rgba(213, 231, 255, .15);
}
body[data-theme="dark"] .support-chat,
body[data-theme="dark"] .support-empty,
body[data-theme="dark"] .msg {
  background: rgba(18, 29, 45, .72);
  border-color: rgba(221, 236, 255, .16);
}
body[data-theme="dark"] .app-choice-card,
body[data-theme="dark"] .apps-catalog-head > div,
body[data-theme="dark"] .platform-link {
  background: rgba(18, 29, 45, .72);
  border-color: rgba(221, 236, 255, .16);
}
body[data-theme="dark"] .app-choice-card.featured {
  border-color: rgba(35,177,123,.30);
  background:
    radial-gradient(circle at 98% 0, rgba(35,177,123,.16), transparent 13rem),
    linear-gradient(180deg, rgba(18, 32, 50, .92), rgba(14, 27, 43, .86));
}
body[data-theme="dark"] .platform-icon {
  background: color-mix(in srgb, var(--platform-brand) 22%, rgba(221,236,255,.10));
  color: color-mix(in srgb, var(--platform-brand) 72%, #ffffff);
}
body[data-theme="dark"] .app-logo {
  box-shadow: 0 18px 36px rgba(0,0,0,.24);
}
body[data-theme="dark"] .platform-link.primary .platform-icon {
  background: rgba(255,255,255,.92);
  color: var(--platform-brand);
}
body[data-theme="dark"] .msg.user { background: rgba(47, 140, 255, .16); }
body[data-theme="dark"] .msg.ai,
body[data-theme="dark"] .msg.support { background: rgba(32, 201, 151, .15); }
body[data-theme="dark"] .msg.admin { background: rgba(255, 210, 90, .12); }
body[data-theme="dark"] .msg-text a { color: #73b5ff; }
body[data-theme="dark"] p,
body[data-theme="dark"] .tariff-meta,
body[data-theme="dark"] .public-facts small,
body[data-theme="dark"] .home-steps small,
body[data-theme="dark"] .item-main small,
body[data-theme="dark"] .route-text small {
  color: #b9c7d9;
}
body[data-theme="dark"] .public-links a,
body[data-theme="dark"] .landing-nav a,
body[data-theme="dark"] .hero-panel,
body[data-theme="dark"] .public-facts div,
body[data-theme="dark"] .public-list p,
body[data-theme="dark"] .home-steps div,
body[data-theme="dark"] .faq-item {
  background: rgba(20, 38, 60, .78);
  border-color: rgba(213, 231, 255, .14);
  color: #d9e7f7;
}
body[data-theme="dark"] .trust-strip span,
body[data-theme="dark"] .tariff-days,
body[data-theme="dark"] .mini-note {
  background: rgba(221, 236, 255, .08);
  border-color: rgba(221, 236, 255, .14);
  color: #c8d9eb;
}
body[data-theme="dark"] .feature-card::after {
  background: radial-gradient(circle, rgba(35,177,123,.14), transparent 70%);
}
body[data-theme="dark"] .pill {
  background: rgba(221, 236, 255, .10);
  border-color: rgba(221, 236, 255, .18);
  color: #d9e7f7;
}
body[data-theme="dark"] .pill.good {
  color: #8ef0c3;
  background: rgba(35,177,123,.16);
  border-color: rgba(35,177,123,.32);
}
body[data-theme="dark"] .pill.bad {
  color: #ff9aaa;
  background: rgba(217,75,90,.14);
  border-color: rgba(217,75,90,.30);
}
body[data-theme="dark"] .tariff-card {
  background:
    radial-gradient(circle at 16% 0, rgba(25, 118, 243, .18), transparent 16rem),
    linear-gradient(180deg, rgba(23, 42, 66, .96), rgba(14, 28, 46, .96));
  border-color: rgba(198, 221, 255, .18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 18px 42px rgba(0,0,0,.20);
}
body[data-theme="dark"] .tariff-card h3,
body[data-theme="dark"] .tariff-price b {
  color: #f8fbff;
}
body[data-theme="dark"] .tariff-card .pill {
  color: #d7e8ff;
  background: rgba(237, 245, 255, .12);
  border-color: rgba(237, 245, 255, .22);
}
body[data-theme="dark"] .tariff-card .btn.primary {
  background: linear-gradient(135deg, #2e8cff, #20c997);
  color: #fff;
  box-shadow: 0 14px 28px rgba(20, 115, 255, .22);
}
body[data-theme="dark"] .btn.ghost {
  background: rgba(221, 236, 255, .08);
  color: #edf5ff;
  border-color: rgba(221, 236, 255, .16);
}
body[data-theme="dark"] .btn:not(.primary):not(.danger):hover,
body[data-theme="dark"] .public-links a:hover {
  background: rgba(221, 236, 255, .13);
}
body[data-theme="dark"] .btn.primary {
  background: linear-gradient(135deg, #2f8cff 0%, #20c997 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 14px 30px rgba(32, 201, 151, .18), 0 10px 24px rgba(47, 140, 255, .16);
}
body[data-theme="dark"] .btn.primary:hover {
  background: linear-gradient(135deg, #4a9cff 0%, #28d8a4 100%);
  box-shadow: 0 18px 36px rgba(32, 201, 151, .22), 0 12px 28px rgba(47, 140, 255, .20);
}
body[data-theme="dark"] .btn.telegram-login {
  background: linear-gradient(135deg, #35b9ff 0%, #1689d6 100%);
  border-color: rgba(84, 194, 255, .36);
  color: #fff;
  box-shadow: 0 16px 34px rgba(19, 142, 222, .24);
}
body[data-theme="dark"] .btn.telegram-login:hover {
  background: linear-gradient(135deg, #54c8ff 0%, #1b9be9 100%);
}
body[data-theme="dark"] .modal { background: #101d2c; }
body[data-theme="dark"] .tab.active { background: #edf5ff; color: #102033; }
body[data-theme="dark"] .notice { color: #b9d8ff; background: rgba(25,118,243,.16); }

.admin-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.admin-tab { border: 1px solid var(--line); background: rgba(255,255,255,.62); color: var(--muted); min-height: 44px; border-radius: 16px; padding: 0 16px; font-weight: 850; }
.admin-tab.active { background: var(--ink); color: white; border-color: transparent; }
.admin-list { display: grid; gap: 12px; margin-top: 16px; min-width: 0; }
.admin-row { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.58); min-width: 0; }
.admin-row-main { min-width: 0; flex: 1; display: grid; gap: 8px; }
.admin-row-main b { overflow-wrap: anywhere; word-break: break-word; }
.admin-row-main small { color: var(--muted); overflow-wrap: anywhere; word-break: break-word; }
.admin-row-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.admin-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-stats span { display: inline-flex; align-items: center; min-height: 30px; padding: 5px 9px; border-radius: 999px; background: rgba(16,32,51,.06); color: var(--muted); font-weight: 750; font-size: 13px; max-width: 100%; overflow-wrap: anywhere; word-break: break-word; }
body[data-theme="dark"] .admin-row,
body[data-theme="dark"] .admin-tab { background: rgba(18,29,45,.72); }
body[data-theme="dark"] .admin-tab.active { background: #edf5ff; color: #102033; }
body[data-theme="dark"] .admin-stats span { background: rgba(237,245,255,.08); }
@media (max-width: 820px) {
  .apps-grid { grid-template-columns: 1fr; }
  .platform-grid { grid-template-columns: 1fr; }
  .admin-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-row { align-items: stretch; flex-direction: column; }
  .admin-row-actions .btn { width: 100%; }
}
@media (max-width: 460px) {
  body.admin-mode .shell { padding-left: 10px; padding-right: 10px; }
  .admin-tabs { grid-template-columns: 1fr; }
  .admin-tab { width: 100%; }
  .admin-stats span { width: 100%; justify-content: flex-start; }
}
