* {
  box-sizing: border-box;
}

/* Основные стили страницы */
body {
  margin: 0; /* Убираем отступы по умолчанию */
  padding: 0;
  background-color: #c0c0c0; /* Серый фон Windows 95 */
  font-family: "Press Start 2P", cursive, "MS Sans Serif", sans-serif;
  color: #000;

  /* Flexbox для центрирования содержимого */
  display: flex;
  justify-content: center; /* Горизонтальное центрирование */
  align-items: center; /* Вертикальное центрирование */
  min-height: 100vh; /* Минимальная высота тела страницы - 100% высоты окна браузера */
  position: relative; /* Для позиционирования анимации */
  overflow: auto; /* Скрываем переполнение */
}

/* Match surrounding typography (browser default is monospace) */
code,
kbd,
samp {
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  padding: 0.1em 0.25em;
  margin: 0 0.05em;
  background-color: #d4d4d4;
  border: 1px solid #808080;
  border-radius: 2px;
  vertical-align: baseline;
  box-shadow: inset 1px 1px 0 #fff;
}

/* Анимация фона */
sky {
  position: fixed; /* Фиксированное позиционирование */
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: black;
  z-index: -2; /* За окном */
}

star {
  border-radius: 50%;
  background: white;
  position: absolute;
  animation: star linear infinite;
}

/* Генерация звезд с помощью CSS */
/* Удалены SASS-циклы, использованы JavaScript для динамической генерации */

/* Анимация звезд */
@keyframes star {
  from {
    transform: translate3d(-100%, 0, 1px);
  }
  to {
    transform: translate3d(100vw, 0, 1px);
  }
}

/* Окно в стиле Windows 95 */
.window {
  width: 78vw;
  max-width: 1400px;
  min-width: 300px; /* Минимальная ширина для маленьких экранов */
  margin: 0 auto;
  border: 2px solid #000080;
  background-color: #c0c0c0;
  box-shadow: 5px 5px #808080;
  display: flex;
  flex-direction: column;
  border-radius: 4px;
  z-index: 1;
}

/* Заголовок окна */
.window-header {
  background-color: #000080; /* Тёмно-синий фон */
  color: #ffffff;
  padding: 4px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  border-bottom: 2px solid #ffffff;
  position: relative;
}

/* Название окна */
.window-title {
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  font-weight: bold;
  flex: 1;
  min-width: 0;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

/* Кнопки управления окном */
.window-controls {
  display: flex;
  gap: 4px;
}

.window-button {
  width: 16px;
  height: 16px;
  background-color: #c0c0c0;
  border: 2px outset #ffffff;
  cursor: pointer;
  position: relative;
}

.window-button::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 2px;
  background-color: #000;
  transform: translate(-50%, -50%);
}

.close-button::after {
  transform: translate(-50%, -50%) rotate(45deg);
}

.minimize-button::after {
  width: 12px;
}

/* Стили для кнопок управления окном */
.close-button {
  background-color: #c0c0c0;
  border: 2px outset #ffffff;
}

.close-button:hover {
  background-color: #ff0000;
}

.minimize-button {
  background-color: #c0c0c0;
  border: 2px outset #ffffff;
}

.minimize-button:hover {
  background-color: #ffff00;
}

/* Содержимое окна */
.window-content {
  padding: 10px;
  background-color: #ffffff;
  border-top: none;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Контейнер для основных и инструкционных элементов */
.content-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
  min-width: 0;
  gap: 20px;
  flex-wrap: wrap; /* Позволяет элементам переноситься на новую строку при необходимости */
}

/* Контейнер с кнопками */
.container {
  flex: 1 1 300px; /* Гибкий размер с минимальной шириной 300px */
  min-width: 0;
  display: flex;
  flex-direction: column;
  text-align: center;
  align-items: center;
  padding: 30px;
  background-color: #c0c0c0;
  box-shadow: inset 0 0 0 1px #808080;
  border: 2px solid #000080;
  border-radius: 4px;
}

/* Картинка */
img {
  max-width: 100%;
  height: auto;
  margin-bottom: 20px;
  image-rendering: pixelated; /* Пиксельная графика */
}

.hero-logo {
  aspect-ratio: 498 / 410;
  display: block;
  width: min(100%, 498px);
}

/* Кнопки */
button.button {
  width: 100%;
  margin-bottom: 0;
  padding: 12px 10px;
  font-size: 14px;
  color: #000000;
  background-color: #c0c0c0;
  border: 2px outset #ffffff;
  border-radius: 2px;
  cursor: pointer;
  transition: background-color 0.1s ease, transform 0.05s ease;
  font-weight: bold;
  font-family: "Press Start 2P", cursive, "MS Sans Serif", sans-serif;
}

button.button:hover {
  background-color: #808080;
}

button.button:active {
  transform: translateY(2px);
  border: 2px inset #ffffff;
}

button.button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

/* Primary generate action: AmneziaWG 2.0 (gradient; Legacy uses default .button gray) */
#generateButtonAwg2 {
  background: linear-gradient(90deg, #2ecc71, #00bcd5);
  box-shadow: 0 4px 8px rgba(46, 204, 113, 0.2),
    0 6px 20px rgba(0, 188, 212, 0.2);
}

#generateButtonAwg2:hover {
  background: linear-gradient(90deg, #27ae60, #0097a7);
}

/* Индикатор загрузки */
.button--loading::after {
  content: "";
  width: 18px;
  height: 18px;
  border: solid rgba(0, 0, 0, 0.1);
  border-top-color: #f15874;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

button.button--loading {
  display: flex;
  justify-content: center;
}

.button.button--loading .button__text {
  display: none;
}

/* Анимация вращения */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Статус ошибки */
#status {
  margin-bottom: 20px;
  color: #434343;
  font-size: 16px;
  font-weight: bold;
}

/* Стили для правой секции: инструкция и thank-you */
.right-section {
  flex: 1 1 400px; /* Гибкий размер с минимальной шириной 400px */
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.right-section__intro {
  display: flex;
  flex-direction: column;
}

.right-section__intro .info-message {
  margin-top: 0;
}

.right-section__intro .onboarding {
  margin-bottom: 0;
}

.right-section__intro .onboarding__summary {
  display: block;
  width: fit-content;
  margin-inline: auto;
}

.right-section__intro .onboarding__body {
  text-align: left;
}

/* Стили для инструкции справа */
.instruction {
  padding: 20px;
  background-color: #c0c0c0;
  box-shadow: inset 0 0 0 1px #808080;
  border: 2px solid #000080;
  border-radius: 4px;
  text-align: left;
  font-family: "Press Start 2P", cursive, "MS Sans Serif", sans-serif;
  overflow-wrap: anywhere;
}

.instruction h2 {
  font-size: 16px;
  margin-bottom: 12px;
  color: #000080;
  line-height: 1.35;
}

.instruction ol {
  margin-left: 20px;
  font-size: 12px;
  line-height: 1.55;
}

.instruction a {
  color: #0000ff;
  text-decoration: underline;
}

.instruction a:hover {
  color: #ff0000;
}

.instruction p {
  font-size: 12px;
  margin-top: 10px;
  line-height: 1.55;
}

/* Стили для блока благодарности и рекламы сервера */
.thank-you {
  padding: 10px;
  background-color: #c0c0c0;
  box-shadow: 2px 2px #808080;
  border: 2px solid #000080;
  border-radius: 4px;
  font-size: 12px; /* Уменьшаем размер шрифта */
  color: #000080;
  text-align: center;
  font-family: "Press Start 2P", cursive, "MS Sans Serif", sans-serif;
}

.thank-you-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px; /* Уменьшаем расстояние между элементами */
}

.thank-you p {
  margin: 0 0 15px 0; /* Увеличиваем отступ снизу для текста */
  line-height: 1.3; /* Уменьшаем интервал между строками */
}

.thank-you p:last-child {
  margin-bottom: 0;
}

/* Inline links inside thank-you blocks (not Discord / web buttons) */
.thank-you a:not(.discord-link):not(.web-link) {
  color: #0000ff;
  text-decoration: underline;
}

.thank-you a:not(.discord-link):not(.web-link):hover {
  color: #ff0000;
}

.buttons {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%; /* Кнопки занимают всю ширину контейнера */
}

.buttons > * {
  margin-top: 0;
  margin-bottom: 0;
}

.discord-link,
.web-link {
  display: flex;
  align-items: center; /* Центрируем элементы по вертикали */
  justify-content: center; /* Центрируем элементы по горизонтали */
  gap: 8px; /* Расстояние между иконкой и текстом */
  padding: 8px 16px; /* Увеличиваем внутренние отступы */
  border: 2px outset #ffffff;
  border-radius: 2px;
  text-decoration: none;
  font-size: 12px;
  font-family: "Press Start 2P", cursive, "MS Sans Serif", sans-serif;
  transition: background-color 0.1s ease, transform 0.05s ease;
  width: 100%; /* Кнопки занимают всю ширину контейнера */
}

.discord-link {
  background-color: #5865f2; /* Цвет Discord */
  color: white;
}

.discord-link:hover {
  background-color: #4752c4; /* Цвет Discord при наведении */
}

.web-link {
  background-color: #d6dafe; /* Жёлтый цвет для кнопки веб-страницы */
  color: black;
}

.web-link:hover {
  background-color: #aeb6ff; /* Более тёмный жёлтый при наведении */
}

.discord-link:active,
.web-link:active {
  transform: translateY(2px);
  border: 2px inset #ffffff;
}

.discord-icon,
.globe-icon {
  width: 24px; /* Уменьшаем размер иконки */
  height: 24px;
  margin: 0; /* Убираем margin у иконки */
}

/* Стили для информационного сообщения */
.info-message {
  background-color: #c0c0c0;
  border: 2px solid #000080;
  box-shadow: inset 0 0 0 1px #808080;
  padding: 10px;
  margin-top: 15px;
  text-align: center;
  font-family: "Press Start 2P", cursive, "MS Sans Serif", sans-serif;
  font-size: 12px; /* Уменьшаем размер шрифта */
  color: #000080;
  border-radius: 4px;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.info-message p {
  margin: 5px 0; /* Уменьшаем отступы между строками */
  line-height: 1.3; /* Уменьшаем интервал между строками */
}

.info-message p:first-child {
  margin-top: 0;
}

.info-message p:last-child {
  margin-bottom: 0;
}

/* Стили для кликабельного текста */
.info-link {
  color: #0000ff;
  text-decoration: underline;
  cursor: pointer;
  font-size: 12px;
  text-align: center; /* Центрируем текст */
}

button.info-link {
  font: inherit;
  line-height: inherit;
  background: none;
  border: none;
  padding: 0;
  display: block;
  width: 100%;
}

.info-link:hover {
  color: #ff0000;
}

.info-link:focus-visible {
  outline: 2px solid #0c9fc4;
  outline-offset: 2px;
}

/* Стили для модального окна */
.modal {
  display: none; /* По умолчанию скрыто */
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5); /* Затемнение фона */
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  box-sizing: border-box;
}

.modal-heading {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.modal-content {
  background-color: #c0c0c0;
  border: 2px solid #000080;
  box-shadow: inset 0 0 0 1px #808080;
  padding: 20px;
  max-width: 500px;
  width: min(90vw, 500px);
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  text-align: left;
  font-family: "Press Start 2P", cursive, "MS Sans Serif", sans-serif;
  font-size: 12px;
  color: #000080;
  border-radius: 4px;
  position: relative;
  overflow-wrap: anywhere;
}

/* Info modal — wider on desktop */
.modal-content--info {
  max-width: 720px;
  width: min(94vw, 720px);
}

/* Info sections */
.info-section {
  border-top: 2px solid #808080;
  padding-top: 10px;
  margin-top: 10px;
}

.info-section:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.info-section__title {
  font-size: 11px;
  font-weight: 700;
  color: #000080;
  margin: 0 0 8px;
}

/* Side-by-side comparison columns */
.info-compare {
  display: flex;
  gap: 12px;
}

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

.info-compare__label {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 6px;
  margin-bottom: 6px;
  border: 2px solid #000080;
  text-align: center;
}

.info-compare__label--legacy {
  background-color: #d4d0c8;
  color: #000080;
}

.info-compare__label--awg2 {
  background-color: #000080;
  color: #ffffff;
}

.info-list {
  margin: 0;
  padding-left: 14px;
  font-size: 9px;
  line-height: 1.7;
  color: #000;
}

.info-list li {
  margin-bottom: 4px;
}

.modal-content p {
  margin: 10px 0;
  line-height: 1.5;
}

.modal-content a {
  color: #0000ff;
  text-decoration: underline;
}

.modal-content a:hover {
  color: #ff0000;
}

.modal-content.settings-modal__dialog {
  padding: 0;
}

/* Стили для секции доната */
.donate-section {
  padding: 12px 10px 10px;
  text-align: center; /* Центрируем содержимое */
}

.donate-container {
  display: flex;
  align-items: center;
  justify-content: center; /* Центрируем элементы по горизонтали */
  gap: 18px; /* Добавляем отступ между элементами */
  flex-wrap: nowrap;
}

.donate-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex: 3 1 0;
  min-height: 46px;
  padding: 8px 18px;
  color: #000;
  background: linear-gradient(180deg, #ffe66d 0%, #ffcf33 100%);
  border: 2px outset #ffffff;
  border-radius: 2px;
  box-shadow: 0 0 0 2px #000080, 0 6px 0 #7f6b00;
  font-family: "Press Start 2P", cursive, "MS Sans Serif", sans-serif;
  font-size: 11px;
  line-height: 1.35;
  text-decoration: none;
  transition: background-color 0.1s ease, box-shadow 0.05s ease, transform 0.05s ease;
}

.donate-link:hover {
  background: linear-gradient(180deg, #fff08f 0%, #ffd84a 100%);
}

.donate-link:active {
  transform: translateY(3px);
  border: 2px inset #ffffff;
  box-shadow: 0 0 0 2px #000080, 0 3px 0 #7f6b00;
}

.donate-link:focus-visible {
  outline: 2px solid #ff0000;
  outline-offset: 4px;
}

.donate-link__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: #fff;
  background-color: #008000;
  border: 2px inset #ffffff;
  border-radius: 50%;
  font-family: "MS Sans Serif", sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.donate-text {
  flex: 2 1 0;
  color: #000;
  font-size: 10px;
  line-height: 1.5; /* Уменьшаем интервал между строками */
  max-width: none;
  margin: 0; /* Центрируем текст */
  white-space: normal;
}

/* Buttons row: gen buttons + gear toggle */
.buttons__row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.buttons__gen-stack {
  flex: 1 1 0%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 10px;
  min-width: 0;
}

.settings-toggle {
  flex: 0 0 44px;
  width: 44px;
  min-height: 44px;
  font-size: 22px;
  line-height: 1;
  background-color: #c0c0c0;
  border: 2px outset #fff;
  border-radius: 2px;
  cursor: pointer;
  font-family: "Press Start 2P", cursive, "MS Sans Serif", sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.1s ease;
}

.settings-toggle:hover {
  background-color: #a0a0a0;
}

.settings-toggle:active,
.settings-toggle[aria-expanded="true"] {
  border: 2px inset #fff;
  background-color: #9090a0;
}

/* Settings modal (above info modal) */
.modal.settings-modal {
  z-index: 1001;
}

.settings-modal__dialog {
  max-width: min(92vw, 800px);
  width: 100%;
  padding: 0;
  display: flex;
  flex-direction: column;
  max-height: min(95vh, 980px);
  max-height: min(95dvh, 980px);
}

.settings-modal__titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: linear-gradient(90deg, #000080 0%, #1084d0 100%);
  border-bottom: 2px solid #000080;
  flex-shrink: 0;
}

.settings-modal__title {
  flex: 1;
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-align: left;
  line-height: 1.3;
  text-shadow: 1px 1px 0 #000;
}

.settings-modal__close {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  padding: 0;
  font-size: 16px;
  line-height: 1;
  font-family: "MS Sans Serif", Tahoma, sans-serif;
  color: #000;
  background-color: #c0c0c0;
  border: 2px outset #fff;
  cursor: pointer;
}

.settings-modal__close:active {
  border: 2px inset #fff;
}

.settings-modal__body {
  padding: 14px 16px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background-color: #c0c0c0;
  flex: 1 1 auto;
  min-height: 0;
}

.settings-modal__subsection {
  margin: 14px 0 8px;
  font-size: 9px;
  font-weight: 700;
  color: #000080;
  letter-spacing: 0.02em;
}

.settings-modal__subsection:first-of-type {
  margin-top: 4px;
}

.cfg-tiles--routes {
  margin-bottom: 4px;
}

.settings-panel__group {
  border: 2px groove #c0c0c0;
  padding: 10px;
  margin: 0 0 10px;
}

.settings-panel__group:last-child {
  margin-bottom: 0;
}

.settings-panel__group > legend {
  font-size: 10px;
  font-weight: bold;
  color: #000080;
  padding: 0 6px;
}

.settings-panel__hint {
  margin: 0 0 8px;
  font-size: 8px;
  line-height: 1.5;
  color: #222;
}

/* Tile grid for DNS / route presets */
.cfg-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.cfg-tile {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 8px;
  line-height: 1.2;
  font-family: "Press Start 2P", cursive, "MS Sans Serif", sans-serif;
  background-color: #c0c0c0;
  border: 2px outset #fff;
  border-radius: 2px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.1s ease;
}

.cfg-tile:hover {
  background-color: #b0c4de;
}

.cfg-tile--active {
  background-color: #6b8cce;
  color: #fff;
  border: 2px inset #fff;
}

.cfg-tile--active:hover {
  background-color: #5a7abf;
}

.cfg-tile input {
  width: 14px;
  height: 14px;
  margin: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.cfg-tile span {
  cursor: pointer;
}

/* Quick action buttons (Популярное в РФ / Снять всё) */
.cfg-tiles-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.cfg-tiles-action {
  flex: 1 1 auto;
  min-width: 120px;
  padding: 8px 10px;
  font-size: 8px;
  font-family: "Press Start 2P", cursive, "MS Sans Serif", sans-serif;
  background-color: #c0c0c0;
  border: 2px outset #fff;
  cursor: pointer;
  border-radius: 2px;
}

.cfg-tiles-action:hover {
  background-color: #a8b8c8;
}

.cfg-tiles-action:active {
  border: 2px inset #fff;
}

.preset-stats {
  min-height: 1.5em;
  margin: 0;
  font-size: 8px;
  color: #333;
  line-height: 1.4;
}

.preset-stats--warn {
  color: #8b4513;
}

/* CIDR limit row: counter + IPv6 toggle side by side */
.cidr-limit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.cidr-counter {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cidr-counter__label {
  font-family: "Press Start 2P", cursive, "MS Sans Serif", sans-serif;
  font-size: 8px;
  color: #333;
  white-space: nowrap;
}

.cidr-counter--warn .cidr-counter__label {
  color: #8b4513;
  font-weight: bold;
}

.cidr-counter--over .cidr-counter__label {
  color: #c00;
  font-weight: bold;
}

.cidr-counter__bar-track {
  height: 12px;
  background: #a0a0a0;
  border: 2px inset #808080;
  position: relative;
  overflow: hidden;
}

.cidr-counter__bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: #000080;
  transition: width 0.25s ease;
}

.cidr-counter--warn .cidr-counter__bar-fill {
  background: #b8720a;
}

.cidr-counter--over .cidr-counter__bar-fill {
  background: #c00;
}

/* IPv6 toggle label */
.ipv6-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 8px;
  cursor: pointer;
  color: #333;
}

.ipv6-toggle input[type="checkbox"] {
  width: 12px;
  height: 12px;
  margin: 0;
  cursor: pointer;
  flex-shrink: 0;
}

/* Disabled route tiles (limit reached) */
.cfg-tile--disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.cfg-tile--disabled input[type="checkbox"] {
  cursor: not-allowed;
}

/* ─────────────────────────────────────────────────────────────
   Gen-slot: обёртка кнопки генерации + post-gen-row (F-02 / F-05)
   ───────────────────────────────────────────────────────────── */

.gen-slot {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
}

.awg3-warp-safe-note {
  grid-column: 1 / -1;
  margin: -6px 0 0;
  padding: 8px 10px;
  border: 1px solid #7a7a7a;
  background: #ffffe1;
  color: #222;
  font: 11px/1.45 Arial, sans-serif;
}

/* Ряд кнопок после генерации: [Скачать (flex-grow)] [👁] [📋 vpn://]
   flex-wrap: на узких экранах copy-vpn-link уезжает на свою строку (см. media 768). */
.post-gen-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  align-items: stretch;
}

/* Браузерный атрибут hidden выставляет display:none, но явный display:flex его перебивает.
   Этот selector восстанавливает приоритет hidden. */
.post-gen-row[hidden] {
  display: none;
}

.post-gen-row__download {
  flex: 1 1 0%;
  min-width: 0;
  margin-bottom: 0;
}

/* Маленькие квадратные кнопки-иконки */
.button.button--icon-sq {
  flex: 0 0 44px;
  width: 44px;
  min-height: 44px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Кнопка просмотра конфига — серый */
.post-gen-row__preview {
  background-color: #555;
  color: #fff;
}
.post-gen-row__preview:hover { background-color: #333; }

.post-gen-row__copy-vpn-link {
  font-size: 13px;
  padding: 6px 12px;
  white-space: nowrap;
  background: var(--accent-secondary, #2d8b6a);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
  margin-bottom: 0;
  min-width: 0;
  flex: 0 1 auto;
}

.post-gen-row__copy-vpn-link:hover {
  background: var(--accent-secondary-hover, #1f6b50);
}

.post-gen-row__copy-vpn-link[hidden] {
  display: none;
}

.result-summary-card,
.diagnostics-card {
  padding: 12px;
  border: 1px solid #7f8c99;
  border-radius: 6px;
  background: #f6f8fa;
  color: #1f2933;
}

.result-summary-card__title,
.diagnostics-card__title {
  margin: 0 0 10px;
  font-size: 15px;
}

.result-summary-card__fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
  margin: 0;
}

.result-summary-card__field {
  min-width: 0;
}

.result-summary-card__field dt {
  color: #52606d;
  font-size: 11px;
}

.result-summary-card__field dd {
  margin: 1px 0 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 600;
}

.result-risk-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.result-risk-list__empty {
  margin: 0;
  color: #287a3d;
  font-size: 12px;
}

.risk-label {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  padding: 7px 9px;
  border-left: 4px solid;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.4;
}

.risk-label strong {
  flex: 0 0 auto;
  text-transform: uppercase;
  font-size: 10px;
}

.risk-label--info {
  border-color: #2f6f9f;
  background: #eaf4fb;
}

.risk-label--warning {
  border-color: #b7791f;
  background: #fff7df;
}

.risk-label--blocking {
  border-color: #b42318;
  background: #fdecec;
}

.diagnostics-card__list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.45;
}

.diagnostics-card__link {
  display: inline-block;
  margin-top: 10px;
  font-size: 12px;
}

@media (max-width: 560px) {
  .result-summary-card__fields {
    grid-template-columns: 1fr;
  }
}

/* ─────────────────────────────────────────────────────────────
   CTA: Telegram-канал (после генерации)
   ───────────────────────────────────────────────────────────── */

.tg-channel-cta {
  margin-top: 12px;
  padding: 10px 14px;
  background-color: #d8eaf8;
  border: 2px solid #000080;
  box-shadow: inset 0 0 0 1px #808080;
  font-size: 11px;
  line-height: 1.55;
}

.tg-channel-cta[hidden] {
  display: none;
}

.tg-channel-cta__text {
  margin: 0 0 10px;
}

.tg-channel-cta__btn {
  display: inline-block;
  text-decoration: none;
  font-size: 11px;
}

/* ─────────────────────────────────────────────────────────────
   Футер: ряд ссылок + кнопка статуса
   ───────────────────────────────────────────────────────────── */

/* Строка: [discord + web (колонка)] [кнопка статуса (растянута)] */
.footer-links-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  width: 100%;
}

.footer-links-col {
  flex: 1 1 0%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

/* Кнопка «Статус сервисов» — высотой как две кнопки слева */
.status-modal-btn {
  flex: 0 0 auto;
  width: 110px;
  align-self: stretch;
  padding: 8px 10px;
  font-size: 10px;
  font-family: "Press Start 2P", cursive, "MS Sans Serif", sans-serif;
  line-height: 1.55;
  text-align: center;
  color: #fff;
  background-color: #7c85f5; /* в тон discord-кнопки #5865f2, чуть светлее */
  border: 2px outset #fff;
  border-radius: 2px;
  cursor: pointer;
  transition: background-color 0.1s ease, transform 0.05s ease;
  overflow-wrap: anywhere;
  display: flex;
  align-items: center;
  justify-content: center;
}
.status-modal-btn:hover  { background-color: #5865f2; }
.status-modal-btn:active { transform: translateY(2px); border: 2px inset #fff; }

/* ─────────────────────────────────────────────────────────────
   F-03: Language switcher
   ───────────────────────────────────────────────────────────── */

.lang-switcher {
  display: flex;
  gap: 3px;
  align-items: center;
  flex-shrink: 0;
}

.lang-btn {
  padding: 2px 6px;
  font-size: 8px;
  font-family: "Press Start 2P", cursive, "MS Sans Serif", sans-serif;
  color: #fff;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 2px;
  cursor: pointer;
  line-height: 1.4;
  transition: background 0.1s ease;
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.lang-btn--active {
  background: rgba(255, 255, 255, 0.25);
  border-color: #fff;
  font-weight: bold;
}

/* ─────────────────────────────────────────────────────────────
   F-05: Предпросмотр конфига
   ───────────────────────────────────────────────────────────── */

.config-preview-section {
  background-color: #c0c0c0;
  border: 2px solid #000080;
  box-shadow: inset 0 0 0 1px #808080;
  border-radius: 4px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.config-preview-section__title {
  font-size: 9px;
  font-weight: bold;
  color: #000080;
  margin: 0;
}

.config-preview-textarea {
  width: 100%;
  height: 200px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
  line-height: 1.45;
  resize: vertical;
  background: #fff;
  border: 2px inset #808080;
  padding: 6px 8px;
  color: #000;
  box-sizing: border-box;
}

/* Компактные вторичные кнопки (копировать и т.п.) */
.button.button--sm {
  width: auto;
  min-width: 120px;
  padding: 8px 12px;
  font-size: 8px;
  margin-bottom: 0;
}

/* ─────────────────────────────────────────────────────────────
   F-07: Ссылка «Статус сервисов» в футере
   ───────────────────────────────────────────────────────────── */

.status-page-link {
  display: inline-block;
  font-size: 8px;
  font-family: "Press Start 2P", cursive, "MS Sans Serif", sans-serif;
  color: #000080;
  text-decoration: underline;
  cursor: pointer;
  padding: 4px 0;
}

.status-page-link:hover {
  color: #ff0000;
}

/* ─────────────────────────────────────────────────────────────
   Модальное окно предпросмотра конфига
   ───────────────────────────────────────────────────────────── */

/* Preview modal must sit above history modal (1002) */
#configPreviewModal {
  z-index: 1003;
}

.modal-content--preview {
  max-width: 600px;
  width: min(94vw, 600px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ─────────────────────────────────────────────────────────────
   Модальное окно подробностей о конфиге
   ───────────────────────────────────────────────────────────── */

.modal-content--result-info {
  max-width: 520px;
  width: min(94vw, 520px);
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.result-info-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.result-info-modal__header .modal-heading {
  margin: 0;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: #555;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.modal-close-btn:hover {
  background: #e8eaed;
  color: #1f2933;
}

/* ─────────────────────────────────────────────────────────────
   Модальное окно статуса сервисов
   ───────────────────────────────────────────────────────────── */

.modal-content--status {
  max-width: 520px;
  width: min(94vw, 520px);
}

.status-loading-msg {
  font-size: 8px;
  color: #555;
  text-align: center;
  padding: 16px 0;
  line-height: 1.6;
}

.status-error-msg {
  font-size: 8px;
  color: #c00;
  text-align: center;
  padding: 16px 0;
  line-height: 1.6;
}

.status-card-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.status-card {
  background: #fff;
  border: 2px solid #000080;
  border-radius: 3px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-indicator {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid rgba(0,0,0,0.2);
}

.status-indicator--ok       { background: #2ecc71; }
.status-indicator--error    { background: #e74c3c; }
.status-indicator--degraded { background: #f39c12; }
.status-indicator--unknown  { background: #aaa; }

.status-card__info {
  flex: 1;
  min-width: 0;
}

.status-card__name {
  font-size: 8px;
  font-weight: bold;
  color: #000080;
  margin-bottom: 3px;
  overflow-wrap: anywhere;
}

.status-card__detail {
  font-size: 7px;
  color: #555;
  line-height: 1.5;
}

.status-badge {
  font-size: 7px;
  font-weight: bold;
  padding: 3px 7px;
  border-radius: 2px;
  border: 2px outset #fff;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge--ok       { background: #2ecc71; color: #fff; }
.badge--error    { background: #e74c3c; color: #fff; }
.badge--degraded { background: #f39c12; color: #fff; }
.badge--unknown  { background: #aaa;    color: #fff; }

.status-last-checked {
  font-size: 7px;
  color: #555;
  text-align: center;
  border-top: 2px groove #c0c0c0;
  padding-top: 10px;
  line-height: 1.7;
}

.status-last-checked strong { color: #000080; }

/* ─────────────────────────────────────────────────────────────
   Кнопка «История»
   ───────────────────────────────────────────────────────────── */

.button--history-open {
  flex: 0 0 auto;
  width: auto !important;
  margin-top: 8px;
  white-space: nowrap;
  background-color: #1a6b8a;
  color: #fff;
  box-shadow: 0 4px 8px rgba(12, 159, 196, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
}

.button--history-open:hover {
  background-color: #0c5a78;
}

.history-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  font-size: 8px;
  background-color: rgba(255, 255, 255, 0.25);
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  line-height: 1;
}

/* ─────────────────────────────────────────────────────────────
   Модальное окно истории генераций
   ───────────────────────────────────────────────────────────── */

.history-modal {
  z-index: 1002;
}

.history-modal__dialog {
  max-width: min(92vw, 680px);
  width: 100%;
  padding: 0;
  display: flex;
  flex-direction: column;
  max-height: min(90vh, 700px);
  max-height: min(90dvh, 700px);
}

.history-modal__titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: linear-gradient(90deg, #000080 0%, #1084d0 100%);
  border-bottom: 2px solid #000080;
  flex-shrink: 0;
}

.history-modal__title {
  flex: 1;
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-align: left;
  line-height: 1.3;
  text-shadow: 1px 1px 0 #000;
}

.history-modal__close {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  padding: 0;
  font-size: 16px;
  line-height: 1;
  font-family: "MS Sans Serif", Tahoma, sans-serif;
  color: #000;
  background-color: #c0c0c0;
  border: 2px outset #fff;
  cursor: pointer;
}

.history-modal__close:active {
  border: 2px inset #fff;
}

.history-modal__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background-color: #c0c0c0;
  padding: 0;
}

.history-modal__footer {
  flex-shrink: 0;
  padding: 10px 14px;
  background-color: #c0c0c0;
  border-top: 2px groove #808080;
  display: flex;
  justify-content: flex-end;
}

.history-empty-msg {
  font-family: "Press Start 2P", cursive, "MS Sans Serif", sans-serif;
  font-size: 8px;
  color: #555;
  text-align: center;
  padding: 32px 20px;
  line-height: 1.8;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 2px groove #808080;
  background-color: #c0c0c0;
  transition: background-color 0.1s ease;
}

.history-item:last-child {
  border-bottom: none;
}

.history-item:hover {
  background-color: #b0c4de;
}

.history-item__badge {
  flex-shrink: 0;
  padding: 3px 7px;
  font-family: "Press Start 2P", cursive, "MS Sans Serif", sans-serif;
  font-size: 7px;
  font-weight: bold;
  border: 2px outset #fff;
  border-radius: 2px;
  white-space: nowrap;
}

.history-item__badge--legacy {
  background-color: #d4d0c8;
  color: #000080;
}

.history-item__badge--awg2 {
  background: linear-gradient(90deg, #2ecc71, #00bcd5);
  color: #fff;
}

.history-item__badge--awg3,
.history-item__badge--awg31 {
  background: linear-gradient(90deg, #7b61ff, #00bcd5);
  color: #fff;
}

.history-item__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.history-item__time {
  font-family: "Press Start 2P", cursive, "MS Sans Serif", sans-serif;
  font-size: 7px;
  color: #000080;
  white-space: nowrap;
}

.history-item__presets {
  font-family: "Press Start 2P", cursive, "MS Sans Serif", sans-serif;
  font-size: 6px;
  color: #444;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item__actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.history-item__dl {
  padding: 6px 10px !important;
  font-size: 8px !important;
  min-width: 44px !important;
  margin-bottom: 0 !important;
}

.history-item__preview {
  padding: 6px 10px !important;
  font-size: 8px !important;
  min-width: 44px !important;
  margin-bottom: 0 !important;
  background-color: #555 !important;
  color: #fff !important;
}

.history-item__preview:hover {
  background-color: #333 !important;
}

/* ── Win95 Tabs ─────────────────────────────────────────────────────────── */

/* Hide the radio inputs completely */
.tabs-win95__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

/* Tab container fills the modal body */
.tabs-win95 {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

/* Tab bar — Win95 style row of tabs */
.tabs-win95__bar {
  display: flex;
  flex-shrink: 0;
  gap: 2px;
  padding: 6px 8px 0;
  background: #c0c0c0;
  border-bottom: 2px solid #808080;
}

/* Individual tab label */
.tabs-win95__tab {
  font-family: "Press Start 2P", cursive, "MS Sans Serif", sans-serif;
  font-size: 9px;
  line-height: 1.4;
  padding: 8px 14px 9px;
  background: #b0b0b0;
  border: 2px solid;
  border-color: #fff #808080 #808080 #fff;
  border-bottom: none;
  cursor: pointer;
  position: relative;
  bottom: -2px;
  white-space: nowrap;
  color: #333;
  user-select: none;
  transition: background-color 0.05s;
}

.tabs-win95__tab:hover {
  background: #c8c8c8;
  color: #000;
}

/* Active tab: raised above the bar, no bottom border, merges with content */
#tab-routes:checked ~ .tabs-win95__bar label[for="tab-routes"],
#tab-dnscps:checked ~ .tabs-win95__bar label[for="tab-dnscps"],
#tab-extra:checked  ~ .tabs-win95__bar label[for="tab-extra"] {
  background: #c0c0c0;
  border-color: #fff #808080 #c0c0c0 #fff;
  padding-bottom: 11px;
  z-index: 1;
  font-weight: bold;
  color: #000080;
  font-size: 10px;
}

/* Content area */
.tabs-win95__content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #c0c0c0;
  border: 2px inset #808080;
  padding: 14px 16px;
}

/* All panels hidden by default */
.tab-panel {
  display: none;
}

/* Show the active panel */
#tab-routes:checked ~ .tabs-win95__content #panel-routes,
#tab-dnscps:checked ~ .tabs-win95__content #panel-dnscps,
#tab-extra:checked  ~ .tabs-win95__content #panel-extra {
  display: block;
}

/* ── CPS radio tiles ────────────────────────────────────────────────────── */

.cps-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.cps-radio-tile {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: #d4d0c8;
  border: 2px outset #fff;
  cursor: pointer;
  font-family: "Press Start 2P", cursive, "MS Sans Serif", sans-serif;
  font-size: 7px;
  white-space: nowrap;
  user-select: none;
  transition: background-color 0.05s;
}

.cps-radio-tile:hover {
  background: #b8d4f0;
}

.cps-radio-tile input[type="radio"] {
  accent-color: #000080;
  width: 12px;
  height: 12px;
  margin: 0;
  cursor: pointer;
}

.cps-radio-tile:has(input:checked) {
  background: #000080;
  color: #fff;
  border-style: inset;
}

/* ── Extra options (Tab 3) ──────────────────────────────────────────────── */

.extra-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.extra-option-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  background: #d4d0c8;
  border: 2px inset #808080;
  cursor: pointer;
  user-select: none;
}

.extra-option-row input[type="checkbox"] {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  margin-top: 2px;
  accent-color: #000080;
  cursor: pointer;
}

.extra-option-row__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.extra-option-row__label {
  font-family: "Press Start 2P", cursive, "MS Sans Serif", sans-serif;
  font-size: 8px;
  color: #000;
  line-height: 1.4;
}

.extra-option-row__hint {
  font-family: "Press Start 2P", cursive, "MS Sans Serif", sans-serif;
  font-size: 6px;
  color: #555;
  line-height: 1.6;
}

.extra-option-row:has(input:checked) {
  background: #c0d8f0;
  border-style: inset;
}

/* CIDR counter in extra tab */
.extra-options .cidr-counter {
  padding: 8px 10px;
  background: #d4d0c8;
  border: 2px inset #808080;
}

/* Zero-CIDR tile warning */
.cfg-tile--zero-cidr {
  opacity: 0.7;
  border-color: #c0392b #800000 #800000 #c0392b !important;
}

.cfg-tile__zero-warn {
  display: block;
  font-family: "Press Start 2P", cursive, "MS Sans Serif", sans-serif;
  font-size: 5px;
  color: #c0392b;
  margin-top: 3px;
  line-height: 1.4;
  text-align: center;
  cursor: help;
}

.cfg-tile--zero-cidr.cfg-tile--active .cfg-tile__zero-warn {
  color: #ff8080;
}

/* Mini CIDR counter on Routes tab */
.cidr-counter-mini {
  font-family: "Press Start 2P", cursive, "MS Sans Serif", sans-serif;
  font-size: 7px;
  color: #444;
  padding: 3px 6px;
  background: #d4d0c8;
  border: 1px inset #808080;
  display: inline-block;
  margin-bottom: 6px;
}

.cidr-counter-mini--warn {
  color: #8b4513;
  font-weight: bold;
}

.cidr-counter-mini--over {
  color: #c00;
  font-weight: bold;
}

/* Reset button in settings titlebar */
.settings-modal__reset {
  font-family: "Press Start 2P", cursive, "MS Sans Serif", sans-serif;
  font-size: 7px;
  padding: 3px 8px;
  background: #c0c0c0;
  border: 2px outset #fff;
  color: #000;
  cursor: pointer;
  white-space: nowrap;
  margin-right: 6px;
}

.settings-modal__reset:hover {
  background: #d4d0c8;
}

.settings-modal__reset:active {
  border-style: inset;
}

/* CPS recommended badge */
.cps-radio-tile__badge {
  font-size: 8px;
  color: #ffd700;
  margin-left: 2px;
  line-height: 1;
}

.cps-radio-tile--recommended:has(input:checked) .cps-radio-tile__badge {
  color: #ffd700;
}

/* hint paragraph in settings panel */
.settings-panel__hint {
  font-family: "Press Start 2P", cursive, "MS Sans Serif", sans-serif;
  font-size: 6px;
  color: #444;
  line-height: 1.8;
  margin: 0 0 8px;
}

/* Danger button variant */
.button.button--danger {
  background-color: #c0392b;
  color: #fff;
  box-shadow: 0 4px 8px rgba(192, 57, 43, 0.2);
}

.button.button--danger:hover {
  background-color: #a93226;
}

/* Адаптивные стили для экранов различных размеров */

/* Для очень больших экранов */
@media (min-width: 1201px) {
  .window {
    width: 78vw;
  }
}

/* Для больших экранов (Laptop) */
@media (max-width: 1200px) and (min-width: 1025px) {
  .window {
    width: 88vw;
  }
}

/* Для средних экранов (Tablet) */
@media (max-width: 1024px) and (min-width: 769px) {
  .window {
    width: 92vw;
  }
  .donate-text {
    font-size: 11px;
  }
}

/* Адаптивные стили для малых экранов (Mobile и планшеты) */
@media (max-width: 768px) {
  body {
    align-items: flex-start;
    justify-content: flex-start;
    padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right))
      max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  }

  .window {
    max-width: 100%;
  }

  .window-header {
    font-size: 12px;
  }

  .content-wrapper {
    flex-direction: column;
    align-items: stretch;
  }

  .container,
  .right-section {
    width: 100%; /* Занимают всю ширину родительского контейнера */
    max-width: 100%; /* Убедимся, что не выходят за пределы */
    padding: 15px; /* Уменьшаем отступы для мобильных устройств */
  }

  img {
    margin-bottom: 15px;
  }

  button.button {
    font-size: 11px;
    padding: 10px 12px;
    min-height: 44px;
    line-height: 1.35;
  }

  .discord-link,
  .web-link {
    min-height: 44px;
    padding: 10px 12px;
  }

  #status {
    font-size: 14px;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  button.info-link {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
  }

  .instruction {
    width: 100%;
    margin-top: 20px;
    padding: 15px; /* Увеличиваем отступы для инструкции */
  }

  .instruction h2 {
    font-size: 14px;
  }

  .instruction ol {
    font-size: 12px;
  }

  .instruction p {
    font-size: 12px;
  }

  .thank-you {
    width: 100%;
    max-width: 100%;
    font-size: 12px;
  }

  .donate-text {
    font-size: 12px;
    max-width: 100%; /* Делаем текст занимать всю ширину родительского контейнера */
  }

  /* Stack info columns on tablet */
  .info-compare {
    flex-direction: column;
    gap: 8px;
  }

  /* Post-gen row на узких экранах: Download растягивается на всю ширину
     первой строки рядом с 👁; копи-vpn-кнопка уезжает на свою строку под ними,
     занимая всю ширину. Иначе nowrap-текст переполняет flex-ряд. */
  .post-gen-row__copy-vpn-link {
    flex: 1 0 100%;
    text-align: center;
  }
}

/* Для очень маленьких экранов (Mobile) */
@media (max-width: 480px) {
  .window {
    width: min(95vw, 100%);
    min-width: 0;
  }

  .window-header {
    font-size: 12px;
  }

  .container,
  .right-section {
    padding: 10px; /* Уменьшаем отступы для очень маленьких экранов */
  }

  button.button {
    font-size: 12px;
    padding: 10px 10px;
    min-height: 44px;
  }

  .discord-link,
  .web-link {
    font-size: 12px;
    padding: 10px 10px;
    min-height: 44px;
  }

  .buttons {
    gap: 14px;
  }

  .button--history-open {
    flex: 1 1 100%;
  }

  .modal-heading {
    font-size: 12px;
  }

  .modal-content {
    padding: 16px;
    font-size: 12px;
  }

  .modal-content--info {
    width: min(96vw, 720px);
  }

  .modal-content.settings-modal__dialog {
    padding: 0;
  }

  /* Stack comparison columns on mobile */
  .info-compare {
    flex-direction: column;
    gap: 8px;
  }

  .info-section__title {
    font-size: 12px;
  }

  .info-list {
    font-size: 12px;
  }

  .instruction h2 {
    font-size: 13px;
  }

  .instruction ol {
    font-size: 12px;
  }

  .instruction p {
    font-size: 12px;
  }

  .thank-you {
    width: 100%;
    max-width: 100%;
    font-size: 12px;
  }

  .donate-text {
    font-size: 12px;
    max-width: 100%; /* Делаем текст занимать всю ширину родительского контейнера */
  }
}

/* ── Healthcheck indicator ── */
.health-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  margin: 4px 0 8px;
  opacity: 0.85;
}
.health-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #888;
}
.health-status--loading .health-status__dot { background: #888; }
.health-status--ok .health-status__dot      { background: #4caf50; }
.health-status--fail .health-status__dot    { background: #f44336; }
.health-status-group {
  display: flex;
  flex-direction: row;
  gap: 12px;
}
.health-status__label {
  font-size: 0.7rem;
  opacity: 0.55;
  font-weight: 600;
  min-width: 6rem;
}
.health-warn {
  font-size: 0.72rem;
  color: #f5a623;
  margin: 0 0 6px;
  padding: 0;
}

/* ── Endpoint port select in settings modal ── */
.endpoint-select {
  background: #000;
  color: #0ff;
  border: 2px solid #0ff;
  padding: 4px 8px;
  font-family: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  margin-top: 4px;
}
.endpoint-select:focus { outline: 2px solid #fff; }

/* ── Route Mode Toggle (2.6.0) ─────────────────────────────────────────────── */
.route-mode-block {
  margin-bottom: 12px;
}

.route-mode-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.route-mode-toggle__label {
  font-size: inherit;
  color: #000;
  white-space: nowrap;
  user-select: none;
}

.route-mode-toggle__buttons {
  display: flex;
  gap: 4px;
}

.route-mode-btn {
  padding: 3px 10px;
  font-size: inherit;
  font-family: inherit;
  background-color: #c0c0c0;
  border: 2px outset #ffffff;
  border-radius: 2px;
  cursor: pointer;
  color: #000;
}

.route-mode-btn:hover:not(.route-mode-btn--active) {
  background-color: #808080;
}

.route-mode-btn:active,
.route-mode-btn--active {
  border: 2px inset #ffffff;
  background-color: #c0c0c0;
  color: #000;
}

.route-mode-description {
  font-size: inherit;
  color: #000;
  margin: 0 0 4px;
  min-height: 1.2em;
}

.route-mode-notice--info {
  font-size: inherit;
  color: #000;
  margin: 0 0 8px;
  padding: 3px 6px;
  background-color: #c0c0c0;
  border: 2px inset #ffffff;
}

/* ── AllowedIPs Explanation (2.6.0) ──────────────────────────────────────────── */
.allowed-ips-explanation {
  margin-bottom: 10px;
}

.allowed-ips-explanation__line {
  font-size: inherit;
  color: #000;
  margin: 2px 0;
  line-height: 1.4;
}

/* ── Full Tunnel dimming (2.6.0) ──────────────────────────────────────────────── */
/* Preset tiles become non-interactive in full tunnel mode.
   Checkboxes are NOT disabled so their state survives mode switch. */
.routes-panel--full-tunnel .cfg-tiles--routes,
.routes-panel--full-tunnel .cfg-tiles-actions,
.routes-panel--full-tunnel .cidr-counter-mini,
.routes-panel--full-tunnel #presetStats {
  opacity: 0.4;
  pointer-events: none;
  user-select: none;
}

/* ── Onboarding «Что это?» (2.7.0) ────────────────────────────────────────────── */
/* Компактный inline-disclosure под info-message: без рамки и фона, чтобы не
   конкурировать с hero-логотипом и кнопками генерации. */
.onboarding {
  margin: 4px 0 10px;
  font-size: 11px;
  line-height: 1.55;
}

.onboarding__summary {
  display: inline-block;
  cursor: pointer;
  color: #000080;
  text-decoration: underline;
  text-underline-offset: 2px;
  user-select: none;
  list-style: none;
}

.onboarding__summary::-webkit-details-marker {
  display: none;
}

.onboarding__summary::before {
  content: "▸ ";
  text-decoration: none;
  display: inline-block;
}

.onboarding[open] .onboarding__summary::before {
  content: "▾ ";
}

.onboarding__body {
  margin-top: 6px;
  padding: 6px 12px;
  background-color: #eef1f5;
  border-left: 3px solid #000080;
}

.onboarding__body p {
  margin: 4px 0;
  color: #000;
}

.onboarding__note {
  font-style: italic;
  color: #404040;
}

/* ── Compatibility card (2.7.0) ───────────────────────────────────────────────── */
.compat-card {
  margin-top: 12px;
  padding: 10px 14px;
  background-color: #c0c0c0;
  border: 2px solid #000080;
  font-size: 11px;
  line-height: 1.5;
}

.compat-card[hidden] {
  display: none;
}

.compat-card__title {
  margin: 0 0 6px;
  font-size: 13px;
  color: #000080;
}

.compat-card__format {
  margin-bottom: 6px;
  font-weight: bold;
  color: #000;
}

.compat-card__group {
  margin-top: 6px;
}

.compat-card__group[hidden] {
  display: none;
}

.compat-card__group-title {
  margin: 0 0 2px;
  font-size: 11px;
  color: #000;
}

.compat-card__list {
  margin: 0;
  padding-left: 16px;
  list-style: square;
}

.compat-card__item {
  margin: 2px 0;
}

.compat-card__client {
  font-weight: bold;
  color: #000;
}

.compat-card__meta {
  color: #404040;
}

.compat-card__meta::before {
  content: " — ";
}

.compat-card__warnings {
  margin-top: 8px;
  border-top: 1px solid #808080;
  padding-top: 6px;
}

.compat-card__warnings[hidden] {
  display: none;
}

.compat-card__warning {
  margin: 3px 0;
  color: #000;
}
