/* Шрифт только с флагами стран (Twemoji). unicode-range ограничивает его
   ТОЛЬКО регион-индикаторами, поэтому он не влияет на остальной текст.
   Нужен на Windows: системный Segoe UI Emoji не содержит глифов флагов. */
@font-face {
  font-family: 'Twemoji Country Flags';
  src: url('./assets/TwemojiCountryFlags.woff2') format('woff2');
  unicode-range: U+1F1E6-1F1FF;
  font-display: swap;
}
/* Применяем флаговый шрифт только на десктопе (на Android системные флаги
   рисуются сами — его не трогаем). */
.is-desktop .flag-emoji {
  font-family: 'Twemoji Country Flags', 'Segoe UI Emoji', 'Apple Color Emoji', sans-serif;
}

:root,
:root[data-theme='dark'] {
  --bg-0: #0b0d12;
  --bg-1: #11141b;
  --bg-2: #181c26;
  --border: #232836;
  --text-0: #f3f5fa;
  --text-1: #aab1c0;
  --text-2: #6b7385;
  --accent: #4f8cff;
  --accent-2: #6aa1ff;
  --success: #2ecc71;
  --danger: #ff5a5a;
  --warning: #ffb547;
  --app-bg: radial-gradient(ellipse at top, #1a2034 0%, #0b0d12 60%);
}

:root[data-theme='light'] {
  --bg-0: #f4f6fb;
  --bg-1: #ffffff;
  --bg-2: #eef1f7;
  --border: #dde2ec;
  --text-0: #0f1320;
  --text-1: #4a5160;
  --text-2: #8a92a3;
  --accent: #3066f0;
  --accent-2: #4f82ff;
  --success: #1aaa55;
  --danger: #e63946;
  --warning: #d68a1d;
  --app-bg: radial-gradient(ellipse at top, #e6ecfa 0%, #f4f6fb 60%);
}

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

html,
body,
#root {
  height: 100%;
  width: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Inter, sans-serif;
  background: var(--bg-0);
  color: var(--text-0);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

button:focus,
button:focus-visible {
  outline: none;
}

* {
  -webkit-tap-highlight-color: transparent;
}

input {
  font-family: inherit;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-0);
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  width: 100%;
}

input:focus {
  border-color: var(--accent);
}

.app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--app-bg);
  transition: background 0.25s ease, color 0.25s ease;
}

/* Адаптив: контент масштабируется под ширину окна с разумным верхним лимитом.
   Узкие окна — заполняется почти полностью, широкие — до ~720px по центру,
   очень широкие (≥1200) — до 840px. */
.screen {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}
@media (min-width: 560px) {
  .screen { max-width: 560px; }
  .titlebar { max-width: none; }
}
@media (min-width: 768px) {
  .screen { max-width: 680px; }
}
@media (min-width: 1024px) {
  .screen { max-width: 760px; }
}
@media (min-width: 1280px) {
  .screen { max-width: 840px; }
}
@media (min-width: 900px) {
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at top center, rgba(79,140,255,0.06), transparent 40%);
    z-index: -1;
  }
}

.titlebar {
  -webkit-app-region: drag;
  height: 60px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 20px 14px 0;
  font-size: 12px;
  color: var(--text-2);
  letter-spacing: 0.5px;
  position: relative;
  z-index: 10;
}

.desktop-nav {
  -webkit-app-region: no-drag;
  display: inline-flex;
  align-items: stretch;
  height: 36px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.desktop-nav-btn {
  width: 40px;
  height: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text-0);
  font-size: 17px;
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, transform 0.05s;
}
.desktop-nav-btn:hover {
  background: var(--bg-1);
  color: var(--accent);
}
.desktop-nav-btn:active { transform: scale(0.94); }
.desktop-nav-sep {
  width: 1px;
  align-self: center;
  height: 16px;
  background: var(--border);
  flex-shrink: 0;
}

/* Шестерёнка и бейдж дней внутри titlebar (на главном экране) */
.titlebar-connect {
  -webkit-app-region: no-drag;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  height: 100%;
  gap: 12px;
}
.titlebar-gear {
  -webkit-app-region: no-drag;
  position: relative;
  width: 42px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-0);
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s;
  padding: 0;
}
.titlebar-gear:hover {
  border-color: #00c47a;
  box-shadow: 0 0 0 1px rgba(0,196,122,0.30);
}
.titlebar-connect .sub-badge-static {
  margin-right: 4px;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 4px 20px 24px;
  overflow-y: auto;
}

/* Login */
.login {
  text-align: center;
  justify-content: center;
}

.logo {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  margin: 0 auto 18px;
  background: linear-gradient(135deg, var(--accent), #8b5cff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  box-shadow: 0 10px 30px rgba(79, 140, 255, 0.35);
}

.title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}

.subtitle {
  font-size: 13px;
  color: var(--text-1);
  margin-bottom: 32px;
  line-height: 1.5;
}

.btn {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.08s ease, opacity 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.update-btn { min-height: 48px; }

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

/* Неон-hover: только подсветка границы, текст НЕ меняется. */
.btn:not(:disabled):hover {
  border: 1px solid #00c47a;
  box-shadow: 0 0 0 1px rgba(0,196,122,0.30);
}
/* Для primary/account-vk/account-tg сохраняем градиент текста и фона,
   только добавляем неон-обводку поверх существующего бокс-шэдоу. */
.btn-primary:not(:disabled):hover,
.btn.account-vk:not(:disabled):hover,
.btn.account-tg:not(:disabled):hover {
  box-shadow:
    0 0 0 1px rgba(0,196,122,0.40),
    0 6px 18px rgba(0,196,122,0.20);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  box-shadow: 0 6px 18px rgba(79, 140, 255, 0.35);
}

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

.btn-ghost {
  background: transparent;
  color: var(--text-1);
  font-size: 13px;
}

/* Кнопки выбора аккаунта — брендовые цвета соцсетей */
.btn.account-vk {
  background: linear-gradient(135deg, #5A7CB6, #4A6FAA);
  color: white;
  box-shadow: 0 6px 18px rgba(74, 111, 170, 0.35);
}
.btn.account-tg {
  background: linear-gradient(135deg, #2EA6E0, #229ED9);
  color: white;
  box-shadow: 0 6px 18px rgba(34, 158, 217, 0.35);
}

.btn-danger {
  background: rgba(255, 90, 90, 0.1);
  color: var(--danger);
  border: 1px solid rgba(255, 90, 90, 0.25);
}

/* flex-shrink: 0 — распорки НЕ сжимаются в коротком окне (иначе на маленькой
   высоте flex-колонка .screen съедает их и кнопки «слипаются»). */
.spacer-12 { height: 12px; flex-shrink: 0; }
.spacer-20 { height: 20px; flex-shrink: 0; }
.spacer-32 { height: 32px; }

/* Home */
.home-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  margin-top: 0;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-2);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-1);
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--text-0);
  background: var(--bg-2);
  border: 1px solid var(--border);
  transition: all 0.15s ease;
}

.icon-btn:hover {
  background: var(--bg-1);
  border-color: #00c47a;
  box-shadow: 0 0 0 1px rgba(0,196,122,0.30);
}

.icon-btn:active {
  transform: scale(0.95);
}

.connect-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.power-btn {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: var(--bg-2);
  border: 2px solid var(--border);
  transition: all 0.2s ease;
  padding: 0;
}

.power-btn svg {
  display: block;
}

.power-btn.disconnected {
  color: var(--text-2);
}
/* Hover на power в выключенном состоянии — подсвечивается ТОЛЬКО граница,
   текст/иконка остаются прежними. */
.power-btn.disconnected:hover:not(:disabled) {
  border-color: #00c47a;
  box-shadow: 0 0 0 1px rgba(0,196,122,0.25);
}

.power-btn.connecting {
  color: #00ff9d;
  background: radial-gradient(circle at center, #0a1f17 0%, #050b08 75%);
  border: 3px solid #00ff9d;
  animation: neon-blink 0.9s ease-in-out infinite;
}
:root[data-theme='light'] .power-btn.connecting {
  color: #00b870;
  background: radial-gradient(circle at center, #ffffff 0%, #f0fff8 75%);
  border: 3px solid #00d488;
  animation: neon-blink-light 0.9s ease-in-out infinite;
}
.power-btn.connecting svg {
  filter: drop-shadow(0 0 6px rgba(0, 255, 157, 0.85));
}
@keyframes neon-blink {
  0%, 100% {
    box-shadow:
      0 0 0 6px rgba(0, 255, 157, 0.06),
      0 0 22px rgba(0, 255, 157, 0.55),
      0 0 60px rgba(0, 255, 157, 0.30),
      inset 0 0 28px rgba(0, 255, 157, 0.18);
    opacity: 1;
  }
  50% {
    box-shadow:
      0 0 0 2px rgba(0, 255, 157, 0.04),
      0 0 6px rgba(0, 255, 157, 0.20),
      0 0 14px rgba(0, 255, 157, 0.10),
      inset 0 0 8px rgba(0, 255, 157, 0.06);
    opacity: 0.55;
  }
}
@keyframes neon-blink-light {
  0%, 100% {
    box-shadow:
      0 0 0 6px rgba(0, 212, 136, 0.10),
      0 0 22px rgba(0, 212, 136, 0.55),
      0 0 60px rgba(0, 212, 136, 0.35),
      inset 0 0 24px rgba(0, 212, 136, 0.12);
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}
.power-btn.disconnecting {
  color: #ff8a3d;
  border-color: rgba(255,138,61,0.7);
  background: rgba(255,138,61,0.08);
  animation: pulse 1.2s ease-in-out infinite;
}

.power-btn.connected {
  /* Неон: тёмный центр + ярко-зелёный светящийся контур и иконка */
  color: #00ff9d;
  background: radial-gradient(circle at center, #0a1f17 0%, #050b08 75%);
  border: 3px solid #00ff9d;
  box-shadow:
    0 0 0 6px rgba(0, 255, 157, 0.06),
    0 0 22px rgba(0, 255, 157, 0.55),
    0 0 60px rgba(0, 255, 157, 0.30),
    inset 0 0 28px rgba(0, 255, 157, 0.18);
}

:root[data-theme='light'] .power-btn.connected {
  /* В светлой теме — светлый центр, неон вокруг сохраняется */
  color: #00b870;
  background: radial-gradient(circle at center, #ffffff 0%, #f0fff8 75%);
  border: 3px solid #00d488;
  box-shadow:
    0 0 0 6px rgba(0, 212, 136, 0.10),
    0 0 22px rgba(0, 212, 136, 0.55),
    0 0 60px rgba(0, 212, 136, 0.35),
    inset 0 0 24px rgba(0, 212, 136, 0.12);
}

.power-btn.connected svg {
  filter: drop-shadow(0 0 6px rgba(0, 255, 157, 0.85));
}

:root[data-theme='light'] .power-btn.connected svg {
  filter: drop-shadow(0 0 6px rgba(0, 184, 112, 0.85));
}

.power-btn.error {
  color: var(--danger);
  border-color: var(--danger);
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.04); opacity: 0.85; }
}

.status-text {
  text-align: center;
}

.status-label {
  font-size: 12px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.status-value {
  font-size: 18px;
  font-weight: 600;
}

.server-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  text-align: left;
  transition: border-color 0.15s;
}

.server-card:hover {
  border-color: var(--accent);
}

.flag {
  font-size: 28px;
}

.server-info {
  flex: 1;
}

.server-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.server-meta {
  font-size: 12px;
  color: var(--text-2);
}

.chevron {
  color: var(--text-2);
}

.subscription-info {
  font-size: 12px;
  color: var(--text-2);
  text-align: center;
  margin-top: 16px;
}

/* Subscription screen */
.sub-card {
  background: linear-gradient(135deg, rgba(79, 140, 255, 0.12), rgba(139, 92, 255, 0.12));
  border: 1px solid rgba(79, 140, 255, 0.25);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  margin-bottom: 24px;
}

.sub-emoji {
  font-size: 48px;
  margin-bottom: 12px;
}

.sub-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.sub-desc {
  font-size: 13px;
  color: var(--text-1);
  line-height: 1.5;
  margin-bottom: 20px;
}

.feature-list {
  list-style: none;
  margin-bottom: 24px;
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  font-size: 13px;
  color: var(--text-1);
  border-bottom: 1px solid var(--border);
}

.feature-list li:last-child {
  border-bottom: none;
}

.check {
  color: var(--success);
  font-weight: bold;
}

.back-btn {
  align-self: flex-start;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-1);
  margin-bottom: 12px;
}

/* Server list */
.server-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.center { text-align: center; }
.muted { color: var(--text-2); font-size: 12px; }

/* Chooser */
.chooser-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  animation: slide-up 0.25s ease;
}

.choice-btn {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.choice-btn:hover {
  border-color: var(--accent);
  background: var(--bg-2);
  transform: translateY(-1px);
}

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

.choice-icon {
  font-size: 28px;
}

.choice-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-0);
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fade-in 0.15s ease;
  padding: 20px;
}

.modal {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 320px;
  text-align: center;
  animation: pop-in 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-icon {
  font-size: 44px;
  margin-bottom: 10px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.modal-desc {
  font-size: 13px;
  color: var(--text-1);
  line-height: 1.5;
  margin-bottom: 20px;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

/* Settings rows + toggle switch */
.settings-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.settings-card + .settings-card,
.spacer-12 + .settings-card { margin-top: 2px; }
/* На десктопе кнопки настроек чуть разрежены (но не слишком — близко к прежнему). */
.is-desktop .settings-card + .settings-card,
.is-desktop .spacer-12 + .settings-card { margin-top: 4px; }
.is-desktop .settings-card { padding: 18px 16px; }
button.settings-card:hover,
.settings-card:hover {
  border-color: #00c47a;
  box-shadow: 0 0 0 1px rgba(0,196,122,0.25);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-row + .settings-row {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.row-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-0);
}

.row-sub {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 2px;
}

.switch {
  position: relative;
  width: 46px;
  height: 26px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  padding: 0;
}

.switch[data-on='true'] {
  background: var(--accent);
  border-color: var(--accent);
}

.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.switch[data-on='true'] .switch-thumb {
  transform: translateX(20px);
}

/* Переключение сервера в процессе — пульс тумблера (как «Подключение…» у VK). */
.switch.switching {
  animation: switch-pulse 1s ease-in-out infinite;
}
.switch.switching .switch-thumb {
  animation: switch-thumb-blink 1s ease-in-out infinite;
}
@keyframes switch-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 196, 122, 0); }
  50% { box-shadow: 0 0 0 4px rgba(0, 196, 122, 0.25); }
}
@keyframes switch-thumb-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
/* Подпись состояния под названием сервера (раздел «Серверы»). */
.srv-status { font-size: 12px; margin-top: 2px; }
.srv-status--on { color: var(--accent, #00c47a); }

.theme-segment {
  display: inline-flex;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}

.theme-segment-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-1);
  border-radius: 7px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.theme-segment-btn[data-active='true'] {
  background: var(--bg-1);
  color: var(--text-0);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* Log panel */
.log-panel {
  margin-top: 8px;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  max-height: 220px;
  overflow-y: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  line-height: 1.5;
  color: #9be39b;
  user-select: text;
  -webkit-user-select: text;
}
.log-line { white-space: pre-wrap; word-break: break-all; }

/* Per-app routing list */
.app-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 12px;
  flex: 1;
  overflow-y: auto;
  padding-bottom: 12px;
}

.app-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 100%;
  text-align: left;
  transition: border-color 0.12s, background 0.12s;
}

.app-row:active {
  transform: scale(0.99);
}

.app-row[data-selected='true'] {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(79, 140, 255, 0.10), rgba(139, 92, 255, 0.06));
}

.app-icon {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-2);
}

.app-icon img {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.app-icon-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #8b5cff);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}

.app-info {
  flex: 1;
  min-width: 0;
}

.app-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-pkg {
  font-size: 10px;
  color: var(--text-2);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-check {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.12s;
}

.app-row[data-selected='true'] .app-check {
  opacity: 1;
}

/* Sessions */
.sessions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.session-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
}
.session-info {
  flex: 1;
  min-width: 0;
}
.session-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-0);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.session-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #00b870;
  background: rgba(0, 184, 112, 0.12);
  border: 1px solid rgba(0, 184, 112, 0.35);
  border-radius: 999px;
  padding: 2px 8px;
}
.session-meta {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 3px;
}
.session-del-btn {
  flex-shrink: 0;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--danger);
}
.session-del-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--danger, #e26a6a);
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
  padding: 0;
}
.session-del-icon:hover {
  background: rgba(226, 106, 106, 0.10);
  border-color: rgba(226, 106, 106, 0.45);
}
.session-del-icon:active {
  background: rgba(226, 106, 106, 0.18);
}

/* Pulsing update button — мигает пока юзер не обновится */
.btn.pulse-update {
  animation: pulse-update 1.4s ease-in-out infinite;
}
@keyframes pulse-update {
  0%, 100% { box-shadow: 0 6px 18px rgba(69,181,156,0.35); transform: translateY(0); }
  50%      { box-shadow: 0 10px 28px rgba(69,181,156,0.65), 0 0 0 4px rgba(69,181,156,0.18); transform: translateY(-1px); }
}

/* Settings header with user_id + logout */
.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.settings-header-left {
  flex: 1;
  min-width: 0;
}
.settings-user-id {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 4px;
  letter-spacing: 0.3px;
  font-variant-numeric: tabular-nums;
}
.logout-icon-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 70, 70, 0.08);
  border: 1px solid rgba(255, 70, 70, 0.3);
  color: var(--danger, #ff4646);
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}
.logout-icon-btn:active {
  background: rgba(255, 70, 70, 0.18);
  transform: scale(0.95);
}

/* About text blocks */
.about-text {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-1);
  white-space: pre-wrap;
}


/* SpeedTest */
.speed-card {
  position: relative;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px 14px 14px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.speed-gauge-wrap {
  position: relative;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
}

.speed-gauge {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.speed-phase-floating {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14%;
  text-align: center;
  font-size: 12px;
  color: var(--text-1);
  letter-spacing: 0.3px;
  font-weight: 500;
  pointer-events: none;
}

.speed-phase-floating[data-active='true'] {
  color: var(--accent-2);
  animation: speed-pulse 1.4s ease-in-out infinite;
}

.speed-number {
  font-size: clamp(42px, 14vw, 58px);
  font-weight: 800;
  line-height: 1;
  color: var(--text-0);
  letter-spacing: -1.5px;
  font-variant-numeric: tabular-nums;
}

.speed-unit {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 4px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: 600;
}

.speed-phase {
  font-size: 12px;
  color: var(--text-1);
  margin-top: 10px;
  letter-spacing: 0.3px;
  font-weight: 500;
  height: 16px;
}

.speed-phase[data-active='true'] {
  color: var(--accent-2);
  animation: speed-pulse 1.4s ease-in-out infinite;
}

@keyframes speed-pulse {
  0%, 100% { opacity: 0.55; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-1px); }
}

.speed-stats {
  display: grid;
  /* minmax(0, 1fr) обязательно — иначе содержимое (тип "100 мс") может
     раздуть колонку шире 1fr и третья карточка вылезет за пределы. */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
  position: relative;
  z-index: 1;
}

.speed-stat {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.2s ease;
}

.speed-stat[data-active='true'] {
  border-color: var(--accent);
  background: rgba(79, 140, 255, 0.10);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(79, 140, 255, 0.15);
}

.speed-stat-icon {
  font-size: 18px;
  font-weight: 700;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 8px;
  background: var(--bg-2);
  color: var(--text-1);
}

.speed-stat[data-active='true'] .speed-stat-icon {
  background: var(--accent);
  color: #fff;
}

.speed-stat-body {
  min-width: 0;
  flex: 1;
}

.speed-stat-label {
  font-size: 10px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
}

.speed-stat-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-0);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.speed-stat-value span {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-2);
  margin-left: 4px;
}

.speed-error {
  color: var(--danger);
  font-size: 13px;
  text-align: center;
  margin-top: 12px;
  padding: 10px;
  background: rgba(255, 90, 90, 0.08);
  border: 1px solid rgba(255, 90, 90, 0.25);
  border-radius: 10px;
}

.speed-cta {
  background: var(--accent);
  box-shadow: 0 6px 18px rgba(79, 140, 255, 0.28);
}

.speed-cta.btn-ghost {
  background: var(--bg-2);
  box-shadow: none;
}

.speed-hint {
  font-size: 11px;
  text-align: center;
  margin-top: 12px;
  color: var(--text-2);
  letter-spacing: 0.3px;
}

/* Notification dot */
.icon-btn {
  position: relative;
}

.notif-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 2px var(--bg-0);
  animation: notif-blink 1.1s ease-in-out infinite;
  pointer-events: none;
}

.notif-dot.inline {
  position: static;
  display: inline-block;
  margin-left: 6px;
  box-shadow: 0 0 0 2px var(--bg-1);
}

@keyframes notif-blink {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 2px var(--bg-0), 0 0 0 0 rgba(255, 90, 90, 0.6);
  }
  50% {
    opacity: 0.55;
    transform: scale(0.85);
    box-shadow: 0 0 0 2px var(--bg-0), 0 0 0 8px rgba(255, 90, 90, 0);
  }
}

.settings-card.attention {
  border-color: rgba(255, 90, 90, 0.45);
  box-shadow: 0 0 0 1px rgba(255, 90, 90, 0.25), 0 6px 18px rgba(255, 90, 90, 0.10);
  animation: card-attention 1.6s ease-in-out infinite;
}

@keyframes card-attention {
  0%, 100% { box-shadow: 0 0 0 1px rgba(255, 90, 90, 0.25), 0 6px 18px rgba(255, 90, 90, 0.10); }
  50% { box-shadow: 0 0 0 1px rgba(255, 90, 90, 0.55), 0 6px 22px rgba(255, 90, 90, 0.22); }
}

.power-btn.locked {
  opacity: 0.55;
  filter: grayscale(0.35);
}

/* Subscription badge */
.sub-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-0);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.1s ease, background 0.15s ease;
}

.sub-badge:active {
  transform: scale(0.96);
}

.sub-badge:disabled {
  cursor: default;
  opacity: 1;
}
.sub-badge:disabled:active {
  transform: none;
}

.sub-badge-static {
  cursor: default;
}
.sub-badge-static:active {
  transform: none;
}

/* Метка «2G» в бейдже дней (когда активен режим 2G). */
.sub-badge-2g {
  font-weight: 700;
  color: var(--brand, #00c47a);
  letter-spacing: 0.3px;
}

.sub-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px rgba(46, 204, 113, 0.5);
}

.sub-badge.urgent {
  background: rgba(255, 90, 90, 0.12);
  border-color: rgba(255, 90, 90, 0.45);
  color: var(--danger);
  animation: sub-pulse 1.2s ease-in-out infinite;
}

.sub-badge.urgent::before {
  background: var(--danger);
  box-shadow: 0 0 6px rgba(255, 90, 90, 0.7);
  animation: sub-dot-pulse 1.2s ease-in-out infinite;
}

@keyframes sub-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 90, 90, 0.35);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(255, 90, 90, 0);
    transform: scale(1.03);
  }
}

@keyframes sub-dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.75); }
}

/* home-header (шестерёнка + бейдж) — без отрицательного margin-top,
   иначе на Android шестерёнка обрезается верхней границей экрана. */
.home-header {
  margin-top: 0;
  padding-top: 4px;
}

/* Notifications screen */
.empty-state {
  margin: 60px auto 0;
  text-align: center;
  max-width: 280px;
}

.empty-icon {
  font-size: 56px;
  opacity: 0.55;
  margin-bottom: 14px;
  filter: grayscale(0.3);
}

.empty-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-0);
  margin-bottom: 6px;
}

.empty-desc {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
}

.notif-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notif-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 14px 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.notif-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}

.notif-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-0);
  flex: 1;
}

.notif-date {
  font-size: 11px;
  color: var(--text-2);
  white-space: nowrap;
}

.notif-body {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-1);
}

/* Routing screen — кнопки "выбрать все / убрать все" */
.routing-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.routing-action-btn {
  flex: 1;
  padding: 10px;
  font-size: 13px;
}

.routing-counter {
  font-size: 12px;
  margin: 10px 4px 4px;
  text-align: right;
}

/* SpeedTest — адаптация stat-карточек под узкие экраны */
@media (max-width: 380px) {
  .speed-stats {
    gap: 6px;
  }

  .speed-stat {
    padding: 8px 6px;
    gap: 6px;
  }

  .speed-stat-icon {
    width: 24px;
    height: 24px;
    font-size: 16px;
  }

  .speed-stat-label {
    font-size: 9px;
  }

  .speed-stat-value {
    font-size: 14px;
  }

  .speed-stat-value span {
    font-size: 9px;
    margin-left: 2px;
  }
}

@media (max-width: 340px) {
  .speed-stats {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 4px;
  }

  .speed-stat-icon {
    display: none;
  }
}

/* Notification delete button */
.notif-card-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.notif-delete-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.notif-delete-btn:hover {
  background: rgba(255, 90, 90, 0.10);
  border-color: rgba(255, 90, 90, 0.4);
  color: var(--danger);
}

.notif-delete-btn:active {
  transform: scale(0.92);
}

/* ─── Auth Screen (email login) ───────────────────────────── */
.auth-screen {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  padding: 36px 24px;
  min-height: 100vh;
  max-width: 420px;
  margin: 0 auto;
}
.auth-logo {
  font-size: 56px;
  text-align: center;
  margin-bottom: 14px;
  display: flex;
  justify-content: center;
}
.auth-logo img {
  width: 96px;
  height: 96px;
  display: block;
  filter: drop-shadow(0 8px 24px rgba(79, 140, 255, 0.25));
}
.auth-title {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  margin: 0 0 6px;
  color: var(--text);
}
.auth-subtitle {
  font-size: 14px;
  text-align: center;
  color: var(--text-2);
  margin: 0 0 28px;
  line-height: 1.5;
}
.auth-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
  margin-bottom: 12px;
}
.auth-input:focus {
  border-color: var(--brand, #45B59C);
}
.auth-input-code {
  text-align: center;
  letter-spacing: 0.5em;
  font-weight: 600;
  font-size: 22px;
  padding-left: 0.5em; /* compensate letter-spacing */
}
.auth-email-pill {
  align-self: center;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(69,181,156,0.10);
  color: var(--brand, #45B59C);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
}
.auth-btn {
  margin-top: 4px;
  margin-bottom: 8px;
}
.auth-btn-soft {
  margin-top: 14px;
  font-size: 13px;
  opacity: 0.7;
}
.auth-error {
  background: rgba(230,57,70,0.10);
  color: var(--danger);
  border: 1px solid rgba(230,57,70,0.25);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 12px;
  text-align: center;
}
.auth-note {
  font-size: 11px;
  color: var(--text-2);
  text-align: center;
  margin-top: 18px;
  line-height: 1.5;
  opacity: 0.7;
}

/* ─── Account Screen ─────────────────────────────────────── */
.account-screen {
  padding: 0 20px 24px;
}
.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  margin-bottom: 18px;
}
.screen-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}
.back-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  font-size: 22px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}
.back-btn:active { background: rgba(0,0,0,0.06); }
.acc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 4px 16px;
  margin-bottom: 22px;
}
.acc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.acc-row:last-child { border-bottom: none; }
.acc-row-label { color: var(--text-2); font-weight: 500; }
.acc-row-value { color: var(--text); font-weight: 600; }
.acc-days { color: var(--brand, #45B59C); }
.acc-days.urgent { color: var(--warning, #f5a623); }
.acc-days.expired { color: var(--text-2); font-weight: 500; }
.acc-pay-btn {
  width: 100%;
  padding: 16px;
  font-size: 15px;
  font-weight: 600;
  margin-top: 14px;
}
.acc-trial-btn {
  width: 100%;
  padding: 14px;
  font-size: 14px;
  font-weight: 600;
}
.acc-pay-price { opacity: 0.85; font-weight: 500; }

/* Windows-устройства в ЛК — компактные карточки */
.win-slot-card {
  margin-top: 2px;
  padding: 12px 14px;
}
.win-slot-card:first-of-type {
  margin-top: 6px;
}

/* Input «На сколько дней» в модалке продления — без number-спиннеров */
.ext-days-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-0);
  color: var(--text);
  box-sizing: border-box;
  -moz-appearance: textfield;
  appearance: textfield;
}
.ext-days-input::-webkit-outer-spin-button,
.ext-days-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}
.acc-logout-btn {
  width: 100%;
  margin-top: 14px;
  color: var(--danger);
}
.acc-banner {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
  text-align: center;
}
.acc-banner.ok { background: rgba(26,170,85,0.10); color: #1aaa55; border: 1px solid rgba(26,170,85,0.25); }
.acc-banner.pending { background: rgba(245,166,35,0.10); color: #d18a0a; border: 1px solid rgba(245,166,35,0.25); }
.acc-banner.fail { background: rgba(230,57,70,0.10); color: var(--danger); border: 1px solid rgba(230,57,70,0.25); }

/* ─── Support chat ───────────────────────────────────────────── */
.support-screen { display: flex; flex-direction: column; height: 100%; padding: 0; }
.support-screen .screen-header { padding: 12px 16px; }

.sup-thread {
  flex: 1; overflow-y: auto; padding: 14px 14px 8px;
  display: flex; flex-direction: column; gap: 8px;
  background: var(--bg-1, transparent);
}
.sup-empty-state {
  text-align: center; color: var(--text-2); padding: 40px 24px; font-size: 14px; line-height: 1.5;
  margin: auto;
}
.sup-msg {
  max-width: 78%; padding: 9px 13px; border-radius: 16px;
  font-size: 14px; line-height: 1.4; word-wrap: break-word;
  display: flex; flex-direction: column; gap: 4px;
}
.sup-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #45B59C, #3DAA92);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.sup-msg.admin {
  align-self: flex-start;
  background: var(--card-2, rgba(127,127,127,0.10));
  color: var(--text-1);
  border-bottom-left-radius: 4px;
}
.sup-msg-body { white-space: pre-wrap; word-break: break-word; }
.sup-msg-image { max-width: 100%; max-height: 280px; border-radius: 10px; cursor: zoom-in; }
.sup-msg-time { font-size: 10px; opacity: 0.65; align-self: flex-end; }

.sup-attach-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; border-top: 1px solid var(--border, rgba(127,127,127,0.2));
  background: var(--card-2, rgba(127,127,127,0.06));
}
.sup-attach-row img { max-height: 56px; max-width: 80px; border-radius: 6px; object-fit: cover; }

.sup-input-row {
  display: flex; gap: 8px; align-items: flex-end;
  padding: 10px 12px 14px;
  border-top: 1px solid var(--border, rgba(127,127,127,0.18));
  background: var(--bg-1, transparent);
}
.sup-input {
  flex: 1; min-height: 44px; max-height: 140px;
  resize: none; padding: 11px 14px;
  border-radius: 14px; border: 1px solid var(--border);
  background: var(--bg-2); color: var(--text-0);
  font-family: inherit; font-size: 14px; line-height: 1.4;
  outline: none;
}
.sup-input::placeholder { color: var(--text-2); }
.sup-input:focus { border-color: #45B59C; }
.sup-attach-btn {
  width: 44px; height: 44px; border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-2); color: var(--text-0);
  cursor: pointer; font-size: 19px; flex: 0 0 auto;
}
.sup-attach-btn:hover:not(:disabled) { border-color: #45B59C; }
.sup-send-btn {
  width: 44px; height: 44px; border-radius: 12px;
  padding: 0 !important; font-size: 18px; flex: 0 0 auto;
}

/* ─── Account screen action buttons (Support / Share) ─────── */
.acc-actions {
  display: flex; flex-direction: column; gap: 10px;
  margin-top: 18px;
}
.acc-action-btn {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 14px 16px;
  background: var(--card, rgba(127,127,127,0.06));
  border: 1px solid var(--border, rgba(127,127,127,0.18));
  border-radius: 14px;
  color: var(--text-1);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: border-color .15s ease, transform .1s ease;
}
.acc-action-btn:hover { border-color: #45B59C; }
.acc-action-btn:active { transform: scale(0.98); }
.acc-action-icon {
  font-size: 22px; flex: 0 0 auto;
}
.acc-action-text {
  display: flex; flex-direction: column; gap: 2px;
  flex: 1; min-width: 0;
}
.acc-action-title {
  font-size: 15px; font-weight: 600; color: var(--text-1);
}
.acc-action-sub {
  font-size: 12px; color: var(--text-2);
}
.acc-action-arrow {
  color: var(--text-2); font-size: 20px; flex: 0 0 auto;
}
.acc-action-badge {
  background: #e63946; color: #fff;
  border-radius: 999px; padding: 2px 9px;
  font-size: 12px; font-weight: 700;
  flex: 0 0 auto;
}

/* ── Image editor (support chat) ─────────── */
.ied-wrap {
  position: fixed; inset: 0; z-index: 1000; background: #000;
  display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.ied-canvas-wrap { flex: 1; position: relative; display: grid; place-items: center; padding: 10px; overflow: hidden; }
.ied-text-popup {
  position: absolute; display: flex; gap: 6px;
  background: rgba(0,0,0,0.85); padding: 6px; border-radius: 8px; transform: translate(-10px, -50px);
}
.ied-text-input {
  min-width: 180px; padding: 8px 12px; border-radius: 6px;
  border: 1px solid #444; background: #1a1a1a; color: #fff; font-size: 14px; outline: none;
}
.ied-bar {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  background: #161c25; border-top: 1px solid #2a323e;
}
.ied-btn {
  width: 44px; height: 44px; border-radius: 10px; border: 0;
  background: #1e2530; color: #e6ecf2; font-size: 20px; font-weight: 700; cursor: pointer;
}
.ied-btn.active { background: #45B59C; color: #fff; }
.ied-btn:disabled { opacity: 0.4; cursor: default; }
.ied-colors { display: flex; gap: 8px; padding: 8px 12px; background: #161c25; justify-content: center; }
.ied-color {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid #2a323e; cursor: pointer;
}
.ied-color.active { border-color: #45B59C; transform: scale(1.15); box-shadow: 0 0 0 2px rgba(69,181,156,0.3); }
.ied-actions {
  display: flex; gap: 10px; padding: 10px 12px; background: #161c25; border-top: 1px solid #2a323e;
}

/* ── Monitoring screen ─────────────────────── */
.mon-screen { gap: 14px; }
.mon-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.mon-card {
  background: var(--bg-1); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px;
}
.mon-card-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: var(--accent);
  color: #fff;
}
.mon-card-accent .mon-label { color: rgba(255,255,255,0.85); }
.mon-card-muted { opacity: 0.7; }
.mon-label { font-size: 11px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.4px; }
.mon-value { font-size: 22px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
.mon-sub { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.mon-card-accent .mon-sub { color: rgba(255,255,255,0.8); }

.mon-chart-wrap {
  background: var(--bg-1); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px;
  margin-top: 4px;
}
.mon-chart-title { font-size: 13px; font-weight: 600; color: var(--text-1); margin-bottom: 12px; }
.mon-chart {
  display: flex; gap: 4px; align-items: flex-end; height: 120px;
}
.mon-bar-col {
  flex: 1; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end; gap: 4px;
}
.mon-bar {
  width: 100%; max-width: 16px;
  background: linear-gradient(180deg, var(--accent), rgba(79,140,255,0.5));
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  transition: height 0.3s ease;
}
.mon-bar-label { font-size: 9px; color: var(--text-2); }
.mon-empty {
  margin-top: 16px; padding: 14px;
  background: var(--bg-2); border-radius: 12px;
  color: var(--text-1); font-size: 13px; text-align: center;
}

/* ── Мониторинг: per-app / per-host секции ── */
.mon-section {
  margin-top: 12px;
  background: var(--bg-2);
  border-radius: 12px;
  overflow: hidden;
}
.mon-section-header {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  background: transparent;
  border: none;
  color: var(--text-1);
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.mon-section-header:hover { background: rgba(255,255,255,0.03); }
.mon-section-chev { color: var(--text-2); font-size: 12px; }
.mon-section-body { padding: 4px 8px 10px; }
.mon-table { display: flex; flex-direction: column; gap: 2px; }
.mon-row {
  display: grid;
  grid-template-columns: 24px 1fr auto auto auto auto;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-1);
}
.mon-row:hover { background: rgba(255,255,255,0.03); }
.mon-row-stale { opacity: 0.55; }
.mon-row-icon { display: flex; align-items: center; justify-content: center; }
.mon-row-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 500;
}
.mon-row-stat { font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 11px; }
.mon-row-ago { font-size: 11px; color: var(--text-2); min-width: 60px; text-align: right; }
.mon-empty-row { padding: 12px; text-align: center; color: var(--text-2); font-size: 12px; }
.mon-badge-warn {
  margin: 6px 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 180, 0, 0.12);
  color: #ffb400;
  font-size: 11px;
  text-align: center;
}
/* host-rows (нет иконки) */
.mon-section .mon-row:not(:has(.mon-row-icon)) {
  grid-template-columns: 1fr auto auto auto auto;
}

/* ============ Раздел «Серверы» с 3D-глобусом (только Android) ============ */
/* Фон-космос: глубокое тёмное небо + лёгкая россыпь звёзд (поверх рисует WebGL). */
.cosmos-bg {
  background:
    radial-gradient(1px 1px at 18% 24%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 72% 16%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1.5px 1.5px at 42% 38%, rgba(200,220,255,0.8), transparent),
    radial-gradient(1px 1px at 86% 52%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 28% 66%, rgba(255,255,255,0.55), transparent),
    radial-gradient(1.5px 1.5px at 62% 78%, rgba(220,230,255,0.7), transparent),
    radial-gradient(1px 1px at 12% 88%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 92% 84%, rgba(255,255,255,0.5), transparent),
    radial-gradient(140% 100% at 50% 30%, #0a0f1c 0%, #05070d 55%, #02030a 100%);
}
/* Полноэкранный контейнер-космос; глобус-холст и оверлей лежат поверх. */
.servers-screen {
  position: relative;
  padding: 0;
  overflow: hidden;
}
/* холст глобуса — на весь экран, под оверлеем (космос виден везде) */
.servers-screen .globe-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
}
.servers-screen .globe-wrap.globe-loaded { opacity: 1; }
.globe-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
/* оверлей: заголовок + зона глобуса (прозрачна для касаний) + список */
.servers-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}
.servers-overlay .settings-header {
  /* титлбар на этом экране убран → сами уводим заголовок из-под статус-бара */
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 20px 0;
  flex-shrink: 0;
  pointer-events: auto;
}
/* Меню «Сервер VK» (cosmos-bg, но без глобуса) — тоже без титлбара */
.cosmos-bg:not(.servers-screen) {
  padding-top: calc(env(safe-area-inset-top, 0px) + 8px);
}
/* пустая верхняя зона над списком — касания «проваливаются» к глобусу */
.globe-touch {
  flex: 0 0 38vh;
  min-height: 220px;
  pointer-events: none;
}
/* список серверов поверх космоса — прокручивается отдельно, фон прозрачный */
.servers-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 20px 24px;
  pointer-events: auto;
}
/* логотип VK в карточке «Сервер VK» */
.vk-logo {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
}
.vk-logo svg { display: block; border-radius: 6px; }
/* мини-логотип VK в бейдже шапки (вместо флага) */
.sub-badge-vk {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  vertical-align: middle;
}

/* ── Прелоадер при переключении Pro ⇄ Lite ── */
.mode-preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0e16;
  animation: mode-fade-in 0.18s ease;
}
.mode-preloader-spin {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid rgba(120, 160, 255, 0.22);
  border-top-color: var(--accent, #4f8cff);
  animation: mode-spin 0.8s linear infinite;
}
@keyframes mode-spin { to { transform: rotate(360deg); } }
@keyframes mode-fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ── Кнопка «Lite версия» внизу настроек / «Pro версия» в ЛК ── */
.lite-switch-btn { margin-top: -14px; }

/* ── Тумблер «Сервер VK» на главном экране Lite (над кнопкой ЛК) ── */
.lite-vk-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: var(--card, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: 14px;
}
.lite-vk-row .lite-vk-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
}
.lite-vk-row .lite-vk-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* Надпись «Lite» вместо иконки настроек в шапке главного экрана */
.lite-badge-label {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.5px;
  color: var(--accent-2, #6aa1ff);
  padding: 6px 4px;
  user-select: none;
}
