  :root{
    --bg: #0C1118;
    --panel: #131A24;
    --panel-2: #171F2B;
    --line: #232D3B;
    --text: #E8EEF4;
    --muted: #8291A3;
    --accent: #2AABEE;
    --accent-rgb: 42,171,238;
    --accent-2: #54C7EC;
    --accent-2-rgb: 84,199,236;
    --ok: #3ECF8E;
    --warn: #F2637A;
    --radius: 14px;
  }

  *{box-sizing:border-box; margin:0; padding:0;}

  html{scroll-behavior:smooth;}

  body{
    background:
      radial-gradient(1100px 600px at 15% -10%, rgba(42,171,238,0.12), transparent 60%),
      radial-gradient(900px 500px at 100% 20%, rgba(84,199,236,0.08), transparent 55%),
      var(--bg);
    color:var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height:1.5;
    -webkit-font-smoothing:antialiased;
    padding-bottom: 84px; /* space for mobile sticky CTA */
  }

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

  .wrap{
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px;
  }

  code, .mono{
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  }

  /* ---------- Header ---------- */
  header{
    position: sticky;
    top:0;
    z-index: 50;
    backdrop-filter: blur(10px);
    background: rgba(12,17,24,0.75);
    border-bottom: 1px solid var(--line);
  }

  .nav{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding: 16px 24px;
    max-width: 1080px;
    margin: 0 auto;
    position:relative;
  }

  .logo{
    display:flex;
    align-items:center;
    gap:10px;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.01em;
    cursor:pointer;
    user-select:none;
  }

  .logo .dot{
    width:10px; height:10px; border-radius:50%;
    background: var(--ok);
    box-shadow: 0 0 0 3px rgba(62,207,142,0.18);
    flex-shrink:0;
  }

  .logo small{
    display:block;
    font-family:'Inter', sans-serif;
    font-weight:400;
    font-size:11px;
    color:var(--muted);
    letter-spacing: 0.02em;
  }

  .logo-caret{ color:var(--muted); flex-shrink:0; transition: transform .2s ease, color .2s ease; }
  .logo:hover .logo-caret, .logo.is-open .logo-caret{ color:var(--text); transform: translateY(1px) rotate(180deg); }

  #nav-menu{
    list-style:none;
    display:flex; flex-direction:column; gap:0;
    position:absolute; top: calc(100% + 10px); left:0;
    min-width:210px;
    background: var(--panel);
    border:1px solid var(--line);
    border-radius:14px;
    padding:8px;
    box-shadow: 0 20px 44px rgba(0,0,0,0.45);
    opacity:0; transform: translateY(-10px) scale(0.97);
    transform-origin: top left;
    pointer-events:none;
    transition: opacity .32s cubic-bezier(0.16,1,0.3,1), transform .32s cubic-bezier(0.16,1,0.3,1);
    z-index:60;
  }
  #nav-menu li{ width:100%; }

  #nav-menu a{
    display:block;
    font-size:14px;
    color:var(--muted);
    padding:10px 12px; border-radius:9px;
    transition: color .15s, background .15s;
  }
  #nav-menu a:hover{ color: var(--text); background: rgba(42,171,238,0.08); }

  .logo:hover + #nav-menu,
  #nav-menu:hover,
  #nav-menu.is-open{
    opacity:1; transform: translateY(0) scale(1);
    pointer-events:auto;
  }

  .nav-cta{
    display:inline-flex;
    align-items:center;
    gap:8px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color:#04141C;
    font-weight:600;
    font-size:14px;
    padding: 10px 18px;
    border-radius: 999px;
    border:none;
    cursor:pointer;
    transition: transform .15s ease, box-shadow .15s ease;
  }
  .nav-cta:hover{ transform: translateY(-1px); box-shadow: 0 8px 20px rgba(42,171,238,0.25); }

  .nav-cta-alt{
    background: transparent;
    color: var(--accent-2);
    border: 1px solid rgba(84,199,236,0.35);
    margin-left: 10px;
  }
  .nav-cta-alt:hover{ background: rgba(84,199,236,0.08); box-shadow:none; }

  .nav-links-mobile-hide{ display:flex; }

  /* ---------- Hero ---------- */
  .hero{
    padding: 72px 0 56px;
    display:grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 48px;
    align-items:center;
  }

  .eyebrow{
    display:inline-flex;
    align-items:center;
    gap:8px;
    font-family:'JetBrains Mono', monospace;
    font-size:12px;
    color: var(--accent-2);
    background: rgba(42,171,238,0.08);
    border: 1px solid rgba(42,171,238,0.25);
    padding: 6px 12px;
    border-radius: 999px;
    margin-bottom: 22px;
  }

  h1{
    font-family:'Space Grotesk', 'Inter', sans-serif;
    font-size: clamp(32px, 4.5vw, 50px);
    line-height: 1.08;
    letter-spacing: -0.02em;
    font-weight: 600;
    margin-bottom: 18px;
  }

  h1 span{
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }

  .hero p.lead{
    color: var(--muted);
    font-size: 17px;
    max-width: 46ch;
    margin-bottom: 30px;
  }

  .hero-actions{
    display:flex;
    align-items:center;
    gap:18px;
    flex-wrap: wrap;
  }

  .btn-primary{
    display:inline-flex;
    align-items:center;
    gap:10px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color:#04141C;
    font-weight:700;
    font-size:15px;
    padding: 15px 26px;
    border-radius: 12px;
    border:none;
    cursor:pointer;
    transition: transform .15s ease, box-shadow .15s ease;
    box-shadow: 0 10px 30px rgba(42,171,238,0.18);
  }
  .btn-primary:hover{ transform: translateY(-2px); box-shadow: 0 14px 34px rgba(42,171,238,0.3); }
  .btn-primary:active{ transform: translateY(0px) scale(0.98); }

  .btn-primary svg{ width:18px; height:18px; }

  .hint{
    font-size:13px;
    color: var(--muted);
  }
  .hint code{ color: var(--accent-2); }

  /* ---------- Signature diagram: proxy tunnel ---------- */
  .tunnel-card{
    background: linear-gradient(180deg, var(--panel), var(--panel-2));
    border:1px solid var(--line);
    border-radius: 20px;
    padding: 28px 22px;
    position:relative;
    overflow:hidden;
  }

  .tunnel-card::before{
    content:"";
    position:absolute;
    inset:0;
    background: radial-gradient(400px 200px at 50% 0%, rgba(42,171,238,0.10), transparent 70%);
    pointer-events:none;
  }

  .tunnel-top{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom: 22px;
  }

  .tunnel-top .label{
    font-family:'JetBrains Mono', monospace;
    font-size:11px;
    color: var(--muted);
    text-transform:uppercase;
    letter-spacing: 0.08em;
  }

  .status-pill{
    display:inline-flex;
    align-items:center;
    gap:6px;
    font-family:'JetBrains Mono', monospace;
    font-size:11px;
    color: var(--ok);
  }
  .status-pill .blip{
    width:7px; height:7px; border-radius:50%;
    background: var(--ok);
    animation: blink 1.6s ease-in-out infinite;
  }
  @keyframes blink{ 0%,100%{opacity:1;} 50%{opacity:0.3;} }

  svg.diagram{ width:100%; height:auto; display:block; }

  .node-label{
    font-family:'JetBrains Mono', monospace;
    font-size: 10.5px;
    fill: var(--muted);
  }

  .packet{
    animation: travel 3.2s linear infinite;
    offset-path: path('M20,60 C 90,20 180,100 260,60');
  }
  @keyframes travel{
    0%{ offset-distance: 0%; opacity:0; }
    8%{ opacity:1; }
    92%{ opacity:1; }
    100%{ offset-distance: 100%; opacity:0; }
  }

  /* ---------- Public proxy-change log feed ---------- */
  .proxy-log-feed{ display:flex; flex-direction:column; gap:8px; }
  .proxy-log-empty{ color:var(--muted); font-size:13px; padding: 6px 2px; }
  .proxy-log-item{
    background: rgba(255,255,255,0.02);
    border:1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
  }
  .proxy-log-top{
    display:flex; align-items:center; justify-content:space-between; gap:10px;
    margin-bottom: 4px;
  }
  .proxy-log-delta{
    font-family:'JetBrains Mono', monospace;
    font-size: 12px;
    display:flex; gap:8px;
  }
  .proxy-log-delta .added{ color: var(--ok); }
  .proxy-log-delta .removed{ color: var(--warn); }
  .proxy-log-date{
    font-family:'JetBrains Mono', monospace;
    font-size: 10.5px;
    color: var(--muted);
    white-space:nowrap;
  }
  .proxy-log-comment{ font-size:12.5px; color: var(--text); line-height:1.4; }

  .stats-row{
    display:grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 22px;
  }
  .stat{
    background: rgba(255,255,255,0.02);
    border:1px solid var(--line);
    border-radius: 10px;
    padding: 12px 10px;
    text-align:center;
  }
  .stat .num{
    font-family:'Space Grotesk', sans-serif;
    font-size:18px;
    font-weight:700;
    color: var(--text);
  }
  .stat .lbl{
    font-size:10.5px;
    color: var(--muted);
    margin-top:2px;
  }

  /* ---------- Section shared ---------- */
  section{ padding: 56px 0; }

  .section-head{
    margin-bottom: 36px;
    max-width: 60ch;
  }

  .section-head .eyebrow{ margin-bottom:14px; }

  h2{
    font-family:'Space Grotesk', sans-serif;
    font-size: clamp(24px, 3vw, 32px);
    font-weight:600;
    letter-spacing:-0.01em;
    margin-bottom: 10px;
  }

  .section-head p{ color: var(--muted); font-size:15px; }

  /* ---------- Steps (real sequence) ---------- */
  .steps{
    display:grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }

  .step{
    background: var(--panel);
    border:1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px 22px;
    position:relative;
  }

  .step .num{
    font-family:'Space Grotesk', sans-serif;
    font-size: 34px;
    font-weight:700;
    color: transparent;
    -webkit-text-stroke: 1.4px var(--accent-2);
    line-height:1;
    margin-bottom: 14px;
  }

  .step h3{
    font-size:16px;
    font-weight:600;
    margin-bottom: 8px;
  }

  .step p{ color: var(--muted); font-size:14px; }

  /* ---------- Features ---------- */
  .features{
    display:grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }

  .feature{
    background: var(--panel);
    border:1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 18px;
  }

  .feature .icon{
    width:36px; height:36px;
    border-radius:10px;
    display:flex; align-items:center; justify-content:center;
    background: rgba(42,171,238,0.1);
    color: var(--accent-2);
    margin-bottom: 14px;
  }
  .feature .icon svg{ width:18px; height:18px; }

  .feature h3{ font-size:15px; font-weight:600; margin-bottom:6px; }
  .feature p{ font-size:13px; color: var(--muted); }

  /* ---------- Server table ---------- */
  .server-panel{
    background: var(--panel);
    border:1px solid var(--line);
    border-radius: var(--radius);
    overflow:hidden;
  }

  .server-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap: 16px;
    padding: 16px 22px;
    border-bottom: 1px solid var(--line);
    font-size: 13.5px;
  }
  .server-row:last-child{ border-bottom:none; }

  .server-row .city{ display:flex; align-items:center; gap:10px; font-weight:500; }
  .flag-dot{ width:8px; height:8px; border-radius:50%; background: var(--ok); flex-shrink:0; }

  .badge{
    font-family:'JetBrains Mono', monospace;
    font-size: 10.5px;
    font-weight: 500;
    color: var(--ok);
    background: rgba(62,207,142,0.1);
    border: 1px solid rgba(62,207,142,0.3);
    padding: 3px 9px;
    border-radius: 999px;
    letter-spacing: 0.01em;
  }

  .row-connect{
    display: inline-block;
    flex-shrink: 0;
    justify-self:end;
    font-family:'JetBrains Mono', monospace;
    font-size:12px;
    color: var(--accent-2);
    border: 1px solid rgba(84,199,236,0.35);
    padding: 6px 12px;
    border-radius: 8px;
    cursor:pointer;
    background:transparent;
    transition: background .15s;
  }
  .row-connect:hover{ background: rgba(84,199,236,0.1); }

  .vpn-row{ flex-wrap: wrap; }
  .vpn-actions{
    display:flex;
    gap: 10px;
    flex-shrink: 0;
  }

  /* ---------- Блог / Telegram-бот ---------- */
  .blog-panel{
    display:flex;
    align-items:center;
    gap: 22px;
    flex-wrap: wrap;
    background: var(--panel);
    border:1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px 30px;
  }
  .blog-badge{
    width:56px; height:56px; border-radius:16px; flex-shrink:0;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display:flex; align-items:center; justify-content:center;
  }
  .blog-badge svg{ width:28px; height:28px; color:#04141C; }
  .blog-body{ flex:1; min-width:240px; }
  .blog-body h3{ font-family:'Space Grotesk', sans-serif; font-size:19px; font-weight:600; margin-bottom:8px; }
  .blog-body p{ color:var(--muted); font-size:14.5px; margin-bottom:20px; max-width:60ch; white-space:pre-line; }
  .blog-actions{ display:flex; gap:12px; flex-wrap:wrap; align-items:center; }
  .blog-empty{ color: var(--muted); font-size:13.5px; }
  .blog-username-note{
    display:inline-flex; align-items:center; gap:8px;
    font-size:13.5px; color: var(--muted);
    background: rgba(148,143,168,0.08); border:1px solid var(--line);
    padding: 10px 16px; border-radius:13px;
  }
  .blog-username-note svg{ width:16px; height:16px; flex-shrink:0; opacity:.7; }
  .blog-username-note b{ color: var(--text); font-weight:700; }
  @media (max-width:640px){
    .blog-panel{ flex-direction:column; text-align:center; }
    .blog-body p{ margin-left:auto; margin-right:auto; }
    .blog-actions{ justify-content:center; }
  }

  /* ---------- CTA band ---------- */
  .cta-band{
    background: linear-gradient(135deg, rgba(42,171,238,0.14), rgba(84,199,236,0.06));
    border: 1px solid rgba(42,171,238,0.25);
    border-radius: 22px;
    padding: 44px 36px;
    text-align:center;
    margin: 24px auto 0;
  }
  .cta-band h2{ margin-bottom:10px; }
  .cta-band p{ color: var(--muted); margin-bottom: 26px; }

  /* ---------- Footer ---------- */
  footer{
    border-top: 1px solid var(--line);
    padding: 32px 0;
    margin-top: 40px;
  }
  .footer-row{
    display:flex;
    justify-content:space-between;
    align-items:center;
    flex-wrap:wrap;
    gap: 12px;
  }
  .footer-row .muted{ color: var(--muted); font-size:13px; }
  .footer-info{ display:flex; flex-direction:column; gap:4px; }
  .footer-links{ display:flex; flex-wrap:wrap; align-items:center; gap:6px 18px; list-style:none; }
  .footer-links a{ color: var(--muted); font-size:13px; text-decoration:none; transition: color .15s ease; }
  .footer-links a:hover{ color: var(--text); }

  /* ---------- Mobile sticky CTA ---------- */
  .mobile-cta{
    display:none;
  }

  /* ---------- Toast ---------- */
  .toast{
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--panel-2);
    border: 1px solid var(--line);
    color: var(--text);
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 14px;
    display:flex;
    align-items:center;
    gap:10px;
    opacity:0;
    pointer-events:none;
    transition: opacity .25s ease, transform .25s ease;
    z-index: 100;
    box-shadow: 0 12px 30px rgba(0,0,0,0.4);
  }
  .toast.show{
    opacity:1;
    transform: translateX(-50%) translateY(0);
  }
  .toast .dot2{ width:8px; height:8px; border-radius:50%; background: var(--ok); flex-shrink:0; }

  /* ---------- Кнопки в строке сервера (Подключить + Сообщить о нерабочем) ---------- */
  .server-row-actions{ display:flex; align-items:center; gap:8px; flex-shrink:0; }
  .row-report{
    display: inline-block;
    flex-shrink: 0;
    font-family:'JetBrains Mono', monospace;
    font-size:11px;
    color: var(--warn);
    border: 1px solid rgba(242,99,122,0.35);
    padding: 6px 10px;
    border-radius: 8px;
    cursor:pointer;
    background:transparent;
    transition: background .15s, border-color .15s;
    white-space:nowrap;
  }
  .row-report:hover{ background: rgba(242,99,122,0.1); border-color: rgba(242,99,122,0.55); }

  /* ---------- Модальное окно жалобы «сервер не работает» ---------- */
  .report-modal{
    display:none; position:fixed; inset:0; z-index:200;
    background: rgba(6,9,14,0.86); backdrop-filter: blur(6px);
    align-items:center; justify-content:center; padding:24px;
  }
  .report-modal.show{ display:flex; }
  .report-modal-inner{
    width:100%; max-width: 420px;
    background: var(--panel); border:1px solid var(--line); border-radius: var(--radius);
    overflow:hidden;
  }
  .report-modal-top{
    display:flex; align-items:center; justify-content:space-between;
    padding: 16px 18px; border-bottom:1px solid var(--line);
  }
  .report-modal-title{ font-weight:700; font-size:14.5px; }
  .report-modal-close{
    background: var(--panel-2); border:1px solid var(--line); color:var(--text);
    width:30px; height:30px; border-radius:9px; cursor:pointer; font-size:16px; line-height:1; flex-shrink:0;
  }
  .report-modal-close:hover{ border-color: rgba(242,99,122,0.5); }
  .report-modal-body{ padding: 18px 20px 20px; }
  .report-modal-body p{ font-size:13.5px; color:var(--text); opacity:.92; line-height:1.5; margin-bottom:16px; }
  .report-modal-body .field{ margin-bottom:18px; }
  .report-modal-body label{ display:block; font-size:12.5px; color:var(--muted); margin-bottom:6px; }
  .report-modal-body input{
    width:100%; background: var(--panel-2); border:1px solid var(--line); color:var(--text);
    font-size:14px; padding:11px 13px; border-radius:9px; outline:none; font-family:inherit;
    transition: border-color .15s;
  }
  .report-modal-body input:focus{ border-color: rgba(242,99,122,0.55); }
  .report-modal-body select{
    width:100%; background: var(--panel-2); border:1px solid var(--line); color:var(--text);
    font-size:14px; padding:11px 13px; border-radius:9px; outline:none; font-family:inherit;
    transition: border-color .15s; cursor:pointer;
    -webkit-appearance:none; appearance:none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23948FA8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat:no-repeat; background-position: right 12px center; background-size:14px;
    padding-right:36px;
  }
  .report-modal-body select:focus{ border-color: rgba(242,99,122,0.55); }
  .report-modal-actions{ display:flex; gap:10px; justify-content:flex-end; }
  .report-btn-cancel{
    font-size:13px; color:var(--muted); border:1px solid var(--line); background:transparent;
    padding:10px 16px; border-radius:9px; cursor:pointer;
  }
  .report-btn-cancel:hover{ color:var(--text); border-color: rgba(255,255,255,0.25); }
  .report-btn-send{
    font-weight:700; font-size:13px; color:#fff; border:none;
    background: var(--warn); padding:10px 18px; border-radius:9px; cursor:pointer;
  }
  .report-btn-send:hover{ opacity:.9; }
  .report-btn-send:disabled{ opacity:.5; cursor:default; }

  /* ================= MOBILE ADAPTATION ================= */
  @media (max-width: 860px){
    .hero{
      grid-template-columns: 1fr;
      padding-top: 40px;
      gap: 34px;
    }
    .steps{ grid-template-columns: 1fr; }
    .features{ grid-template-columns: repeat(2, 1fr); }
  }

  @media (max-width: 640px){
    .wrap{ padding: 0 18px; }
    .nav-cta{ display:none; }
    .nav{ padding: 14px 18px; }
    #nav-menu{ min-width:190px; }
    .hero{ padding: 28px 0 36px; }
    h1{ font-size: 30px; }
    .hero p.lead{ font-size: 15.5px; }
    .features{ grid-template-columns: 1fr; }
    .cta-band{ padding: 32px 20px; border-radius: 18px; }
    .footer-row{ flex-direction: column; align-items:flex-start; }
    .footer-links{ order:-1; gap:8px 14px; }

    .server-row.vpn-row{ flex-direction: column; align-items:flex-start; }
    .vpn-actions{ width:100%; flex-direction: column; }
    .vpn-actions .row-connect{ text-align:center; }

    .server-row{ flex-wrap: wrap; }
    .server-row-actions{ width:100%; flex-direction: column; align-items:stretch; }
    .server-row-actions .row-connect,
    .server-row-actions .row-report{ width:100%; text-align:center; }

    .report-modal-inner{ max-width:100%; }

    /* sticky mobile CTA replaces nav button */
    .mobile-cta{
      display:flex;
      position: fixed;
      left: 16px; right: 16px; bottom: 16px;
      z-index: 60;
    }
    .mobile-cta .btn-primary{
      width:100%;
      justify-content:center;
      padding: 16px 20px;
      font-size:16px;
      box-shadow: 0 14px 34px rgba(0,0,0,0.45);
    }
    body{ padding-bottom: 96px; }
  }

  @media (prefers-reduced-motion: reduce){
    .packet, .blip{ animation: none !important; }
    #nav-menu{ transition: opacity .01ms linear !important; transform:none !important; }
  }

  /* ---------- Maintenance mode ---------- */
  #maintenance-screen{
    display:none;
    min-height:100vh; align-items:center; justify-content:center;
    flex-direction:column; gap:16px; text-align:center; padding:24px;
  }
  html.maintenance-mode #site-content{ display:none !important; }
  html.maintenance-mode #maintenance-screen{ display:flex !important; }
  .maintenance-avatar{
    width:52px; height:52px; border-radius:15px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display:flex; align-items:center; justify-content:center;
    font-family:'Space Grotesk',sans-serif; font-weight:800; font-size:19px; color:#04141C;
  }
  #maintenance-screen h1{ font-family:'Space Grotesk',sans-serif; font-size:26px; }
  #maintenance-screen p{ color:var(--muted); max-width:44ch; font-size:15px; }

  /* ---------- Back to main button ---------- */
  .nav-back{
    display:inline-flex; align-items:center; gap:7px;
    font-size:13px; font-weight:700; color:#fff; text-decoration:none;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border:1px solid transparent; padding:9px 16px; border-radius:9px;
    box-shadow: 0 6px 18px rgba(42,171,238,0.3);
    transition: transform .15s ease, box-shadow .15s ease;
  }
  .nav-back:hover{ color:#fff; transform: translateY(-1px); box-shadow: 0 10px 24px rgba(42,171,238,0.45); }
  .nav-back svg{ width:15px; height:15px; }
  @media (max-width:640px){ .nav-back{ padding:9px 12px; font-size:12px; } }

  /* ---------- Переключатель языка ---------- */
  .lang-switch{ position:relative; }
  .lang-switch-btn{
    display:flex; align-items:center; gap:5px;
    height:36px; padding:0 12px; border-radius:10px;
    color: var(--muted); border:1px solid var(--line); background:transparent;
    font-size:12.5px; font-weight:700; letter-spacing:.02em; cursor:pointer;
    transition: color .15s, border-color .15s, background .15s;
  }
  .lang-switch-btn:hover{ color: var(--text); border-color: rgba(42,171,238,0.5); background: rgba(42,171,238,0.08); }
  .lang-switch-btn svg{ width:12px; height:12px; color:var(--muted); transition: transform .2s ease; }
  .lang-switch.is-open .lang-switch-btn svg{ transform: rotate(180deg); }
  .lang-menu{
    list-style:none;
    position:absolute; top: calc(100% + 10px); right:0;
    min-width:180px; max-height:320px; overflow-y:auto;
    background: var(--panel); border:1px solid var(--line); border-radius:14px;
    padding:8px; box-shadow: 0 20px 44px rgba(0,0,0,0.45);
    opacity:0; transform: translateY(-10px) scale(0.97); transform-origin: top right;
    pointer-events:none;
    transition: opacity .25s cubic-bezier(0.16,1,0.3,1), transform .25s cubic-bezier(0.16,1,0.3,1);
    z-index:60;
  }
  .lang-menu.is-open{ opacity:1; transform: translateY(0) scale(1); pointer-events:auto; }
  .lang-menu li{ width:100%; }
  .lang-menu button{
    display:block; width:100%; text-align:left; font-size:14px; color:var(--muted);
    background:none; border:none; cursor:pointer;
    padding:9px 12px; border-radius:9px; transition: color .15s, background .15s;
  }
  .lang-menu button:hover{ color:var(--text); background: rgba(42,171,238,0.08); }
  .lang-menu button.active{ color:var(--text); background: rgba(42,171,238,0.14); }
  [dir="rtl"] .lang-menu{ right:auto; left:0; transform-origin: top left; }
  [dir="rtl"] .lang-menu button{ text-align:right; }

  .nav-login:hover{ color: var(--text); border-color: rgba(42,171,238,0.5); background: rgba(42,171,238,0.08); }
  @media (max-width: 640px){ .nav-login{ display:flex !important; } }

  /* ---------- Виджет чата с поддержкой ---------- */
  .bg-chat-fab{
    position: fixed; right: 22px; bottom: 22px; z-index: 300;
    width: 58px; height: 58px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display:flex; align-items:center; justify-content:center;
    border:none; cursor:pointer; color:#fff;
    box-shadow: 0 12px 30px rgba(42,171,238,0.45);
    transition: transform .15s ease;
  }
  .bg-chat-fab:hover{ transform: translateY(-2px) scale(1.03); }
  .bg-chat-fab svg{ width:26px; height:26px; }
  .bg-chat-fab .bg-chat-badge{
    position:absolute; top:-4px; right:-4px; background: var(--accent-2);
    color:#fff; font-size:10.5px; font-weight:800; min-width:18px; height:18px;
    border-radius:999px; display:flex; align-items:center; justify-content:center;
    padding:0 4px; border:2px solid var(--bg);
  }

  .bg-chat-window{
    position: fixed; right: 22px; bottom: 92px; z-index: 300;
    width: 380px; max-width: calc(100vw - 32px);
    height: 540px; max-height: calc(100vh - 130px);
    background: var(--panel); border:1px solid var(--line); border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.5);
    display:none; flex-direction:column; overflow:hidden;
  }
  .bg-chat-window.show{ display:flex; }
  .bg-chat-window.bg-dragging{ user-select:none; box-shadow: 0 30px 70px rgba(0,0,0,0.6); }

  .bg-chat-head{
    display:flex; align-items:center; justify-content:space-between; gap:8px;
    padding: 14px 16px; border-bottom:1px solid var(--line);
    background: rgba(42,171,238,0.06); flex-shrink:0;
    cursor: move; touch-action:none;
  }
  .bg-chat-head-title{ font-family:'Sora',sans-serif; font-weight:700; font-size:14px; }
  .bg-chat-head-sub{ font-size:11.5px; color:var(--muted); margin-top:2px; }
  .bg-chat-head-actions{ display:flex; align-items:center; gap:6px; flex-shrink:0; }
  .bg-chat-head-actions button{ cursor:pointer; }
  .bg-chat-end-btn{
    background: transparent; border:1px solid var(--line); color:var(--muted);
    height:26px; padding:0 9px; border-radius:8px; cursor:pointer; font-size:11px; font-weight:600; line-height:1; flex-shrink:0; white-space:nowrap;
  }
  .bg-chat-end-btn:hover{ color: var(--accent-2); border-color: rgba(84,199,236,0.45); }
  .bg-chat-close{
    background: transparent; border:1px solid var(--line); color:var(--muted);
    width:26px; height:26px; border-radius:8px; cursor:pointer; font-size:15px; line-height:1; flex-shrink:0;
  }
  .bg-chat-close:hover{ color:var(--text); border-color: rgba(42,171,238,0.5); }

  .bg-chat-body{ flex:1; overflow-y:auto; padding: 14px 16px; display:flex; flex-direction:column; gap:10px; }

  .bg-chat-form-field{ margin-bottom:12px; }
  .bg-chat-form-field label{ display:block; font-size:12px; color:var(--muted); margin-bottom:5px; }
  .bg-chat-form-field input, .bg-chat-form-field select{
    width:100%; background: var(--panel-2); border:1px solid var(--line); color:var(--text);
    font-size:13.5px; padding:10px 12px; border-radius:9px; outline:none; font-family:inherit;
  }
  .bg-chat-form-field input:focus, .bg-chat-form-field select:focus{ border-color: rgba(42,171,238,0.6); }
  .bg-chat-form-hint{ font-size:12px; color:var(--muted); margin-bottom:14px; }
  .bg-chat-captcha-hint{ font-size:12px; color:var(--muted); margin-bottom:8px; }
  .bg-chat-captcha-target-row{ display:flex; align-items:center; gap:6px; margin-bottom:10px; }
  .bg-chat-captcha-target{
    width:34px; height:34px; border-radius:8px; background: var(--panel-2); border:1px solid var(--line);
    display:flex; align-items:center; justify-content:center; font-size:17px; flex-shrink:0;
  }
  .bg-chat-captcha-target-arrow{ color: var(--muted); font-size:13px; flex-shrink:0; }
  .bg-chat-captcha-grid{ display:grid; grid-template-columns: repeat(3, 1fr); gap:8px; margin-bottom:6px; }
  .bg-chat-captcha-item{
    background: var(--panel-2); border:1px solid var(--line); border-radius:9px;
    height:46px; font-size:19px; cursor:pointer; display:flex; align-items:center; justify-content:center;
    color:var(--text); position:relative;
  }
  .bg-chat-captcha-item:hover:not(:disabled){ border-color: rgba(42,171,238,0.5); }
  .bg-chat-captcha-item.picked{ border-color: var(--ok); background: rgba(62,207,142,0.14); }
  .bg-chat-captcha-item.picked::after{
    content: attr(data-order); position:absolute; top:2px; right:4px; font-size:10px; font-weight:800; color: var(--ok);
  }
  .bg-chat-captcha-item:disabled{ cursor:not-allowed; }
  .bg-chat-captcha-item.wrong{ border-color: var(--accent-2); background: rgba(84,199,236,0.14); }
  .bg-chat-captcha-status{ font-size:12px; margin-bottom:2px; min-height:15px; }
  .bg-chat-captcha-status.ok{ color: var(--ok); }
  .bg-chat-captcha-status.err{ color: var(--accent-2); }
  .bg-chat-captcha-refresh-link{
    background:none; border:none; color:var(--muted); font-size:11.5px; cursor:pointer; text-decoration:underline;
    padding:0; margin-bottom:6px;
  }
  .bg-chat-captcha-refresh-link:hover{ color:var(--text); }
  .bg-chat-submit{
    width:100%; background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color:#fff; font-weight:700; font-size:13.5px; border:none;
    padding: 11px 16px; border-radius:10px; cursor:pointer;
  }
  .bg-chat-submit:disabled{ opacity:.55; cursor:not-allowed; }
  .bg-chat-error{ color: var(--accent-2); font-size:12px; margin-top:8px; display:none; }
  .bg-chat-error.show{ display:block; }

  .bg-chat-msg{ max-width:82%; font-size:13px; padding:9px 12px; border-radius:12px; line-height:1.4; word-wrap:break-word; }
  .bg-chat-msg.user{ align-self:flex-end; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color:#fff; border-bottom-right-radius:4px; }
  .bg-chat-msg.admin{ align-self:flex-start; background: var(--panel-2); border:1px solid var(--line); color:var(--text); border-bottom-left-radius:4px; }
  .bg-chat-msg.system{ align-self:center; background: rgba(42,171,238,0.1); border:1px solid rgba(42,171,238,0.3); color: var(--accent); font-size:12px; text-align:center; }
  .bg-chat-msg .bg-chat-msg-time{ display:block; font-size:10px; opacity:.7; margin-top:4px; }
  .bg-chat-msg .bg-chat-msg-img{
    display:block; max-width:100%; max-height:220px; border-radius:9px; margin-bottom:6px; cursor:zoom-in; object-fit:cover;
  }

  .bg-chat-closed-banner{
    align-self:center; text-align:center; background: rgba(148,143,168,0.1); border:1px solid var(--line);
    color:var(--muted); font-size:12px; padding:14px 16px; border-radius:12px; max-width:92%;
  }
  .bg-chat-closed-banner .bcb-title{ color:var(--text); font-weight:700; font-size:13px; margin-bottom:4px; }
  .bg-chat-restart-btn{
    margin-top:10px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); border:none; color:#fff;
    font-weight:700; font-size:12.5px; padding:9px 16px; border-radius:9px; cursor:pointer;
  }

  .bg-chat-foot{
    display:flex; gap:8px; padding: 12px 14px; border-top:1px solid var(--line); flex-shrink:0;
  }
  .bg-chat-foot input{
    flex:1; background: var(--panel-2); border:1px solid var(--line); color:var(--text);
    font-size:13.5px; padding:10px 12px; border-radius:9px; outline:none; font-family:inherit;
  }
  .bg-chat-foot input:focus{ border-color: rgba(42,171,238,0.6); }
  .bg-chat-send, .bg-chat-attach{
    background: linear-gradient(135deg, var(--accent), var(--accent-2)); border:none; color:#fff;
    width:40px; height:40px; border-radius:9px; cursor:pointer; flex-shrink:0;
    display:flex; align-items:center; justify-content:center;
  }
  .bg-chat-attach{ background: var(--panel-2); border:1px solid var(--line); color:var(--muted); }
  .bg-chat-attach:hover{ color:var(--text); border-color: rgba(42,171,238,0.5); }
  .bg-chat-send:disabled, .bg-chat-attach:disabled{ opacity:.5; cursor:not-allowed; }
  .bg-chat-send svg, .bg-chat-attach svg{ width:17px; height:17px; }

  .bg-chat-resize-handle{
    position:absolute; right:2px; bottom:2px; width:22px; height:22px; z-index:5;
    display:flex; align-items:center; justify-content:center;
    color: var(--muted); cursor: nwse-resize; touch-action:none;
    border-bottom-right-radius: 18px;
  }
  .bg-chat-resize-handle:hover{ color: var(--accent); }
  .bg-chat-resize-handle svg{ width:13px; height:13px; }

  .bg-chat-lightbox{
    position: fixed; inset:0; z-index:400; background: rgba(5,5,10,0.9);
    display:none; align-items:center; justify-content:center; padding:24px; cursor:zoom-out;
  }
  .bg-chat-lightbox.show{ display:flex; }
  .bg-chat-lightbox img{ max-width:100%; max-height:100%; border-radius:10px; }

  /* ---------- Баннер о новом сообщении в чате ---------- */
  .bg-msg-toast{
    position: fixed; top:14px; left:50%; z-index:500;
    display:flex; align-items:center; gap:10px;
    background: var(--panel-2); border:1px solid rgba(42,171,238,0.4);
    color: var(--text); font-size:13.5px; line-height:1.35;
    padding:12px 16px; border-radius:13px; max-width:min(360px, 88vw);
    box-shadow: 0 14px 34px rgba(0,0,0,0.45);
    cursor:pointer; user-select:none;
    transform: translate(-50%, -140%); opacity:0;
    transition: transform .3s ease, opacity .3s ease;
  }
  .bg-msg-toast.show{ transform: translate(-50%, 0); opacity:1; }
  .bg-msg-toast .bmt-dot{
    width:9px; height:9px; border-radius:50%; background: var(--accent); flex-shrink:0; margin-top:3px;
    box-shadow: 0 0 0 4px rgba(42,171,238,0.18);
  }
  .bg-msg-toast .bmt-body b{ display:block; font-weight:700; font-size:13px; margin-bottom:2px; }
  .bg-msg-toast .bmt-body span{ color: var(--muted); }

  @media (max-width:420px){
    .bg-chat-window{ right:16px; left:16px; width:auto; bottom:88px; }
    .bg-chat-fab{ right:16px; bottom:16px; }
  }


/* ---------- Красивый скроллбар — везде, где есть прокрутка ---------- */
*{ scrollbar-width: thin; scrollbar-color: var(--accent) var(--panel-2); }
*::-webkit-scrollbar{ width:9px; height:9px; }
*::-webkit-scrollbar-track{ background: var(--panel-2); border-radius:8px; }
*::-webkit-scrollbar-thumb{
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-radius:8px;
}
*::-webkit-scrollbar-thumb:hover{ background: linear-gradient(180deg, var(--accent-2), var(--accent)); }
*::-webkit-scrollbar-corner{ background: transparent; }
