:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #000000;
  color: #f4f7fb;
  --accent: #34d399;
  --accent-soft: #6ee7b7;
  --accent-glow: rgba(52, 211, 153, .12);
  --muted: #7a8a9e;
  --border: rgba(255, 255, 255, .08);
  --surface: rgba(18, 18, 18, .95);
  --surface-hover: rgba(30, 30, 30, .95);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  -webkit-tap-highlight-color: transparent;
  background: #000000;
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(52, 211, 153, .06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(34, 180, 120, .04) 0%, transparent 50%);
}

/* ===== Card ===== */
.card {
  position: relative;
  z-index: 1;
  width: min(100%, 540px);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  padding: 36px 36px 40px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, .03),
    0 40px 100px rgba(0, 0, 0, .6),
    0 0 80px rgba(52, 211, 153, .03);
  backdrop-filter: blur(24px);
  transition: box-shadow .3s ease;
  animation: card-in .7s cubic-bezier(.22, 1, .36, 1) both;
}
.card:hover {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, .05),
    0 40px 100px rgba(0, 0, 0, .6),
    0 0 120px rgba(52, 211, 153, .06);
}

/* ===== Background FX: летящие точки (canvas #particles) ===== */
.particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ===== Каскадное появление карточки ===== */
@keyframes card-in {
  from { opacity: 0; transform: translateY(22px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.card > * { animation: rise .6s cubic-bezier(.22, 1, .36, 1) both; }
.card > .brand { animation-delay: .08s; }
.card > h1 { animation-delay: .14s; }
.card > .subtitle { animation-delay: .18s; }
.card > .qr-view,
.card > .transfer-view { animation-delay: .26s; }
.card > .site-footer { animation-delay: .34s; }

/* ===== Заголовок: в обычном режиме это просто белые буквы ===== */
.card h1 {
  color: #f4f7fb;
}
/* Во время передачи файлов по заголовку ползёт градиентная волна слева
   направо: класс transfer-active на body ставит app.js, пока в чате есть
   карточки «отправка…»/«получение…». Фон двукратной ширины с двумя
   одинаковыми гребнями — сдвиг ровно на половину даёт бесшовный цикл. */
body.transfer-active .title-shine {
  background-image: linear-gradient(90deg,
    #f4f7fb 0%, #f4f7fb 17%,
    var(--accent-soft) 25%,
    #f4f7fb 33%,
    #f4f7fb 67%,
    var(--accent-soft) 75%,
    #f4f7fb 83%,
    #f4f7fb 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: title-wave 2.4s linear infinite;
}
@keyframes title-wave {
  from { background-position: 100% 0; }
  to { background-position: 0% 0; }
}

/* ===== Иконка в зоне загрузки ===== */
/* Без какого-либо движения: ни анимаций, ни сдвига иконки при наведении. */
.dz-ico {
  justify-self: center;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: var(--accent-soft);
}
.dz-ico svg { width: 22px; height: 22px; }

/* ===== Уважение к reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  .card,
  .card > * {
    animation: none !important;
  }
  /* Без анимации волна не нужна: заголовок остаётся просто белым. */
  body.transfer-active .title-shine {
    animation: none !important;
    background-image: none;
    -webkit-text-fill-color: currentcolor;
  }
}

/* ===== Brand ===== */
.brand {
  text-decoration: none;
  margin-bottom: 16px;
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .22em;
  text-transform: uppercase;
}
.brand span {
  font-size: 18px;
  color: var(--accent-soft);
  opacity: .7;
  line-height: 1;
  transform: translateY(-2px);
}
/* Вторая половина логотипа («TG BOT» / «WEB SITE») — обычный текст бренда,
   без стрелочной стилизации span. */
.brand .brand-mode {
  font-size: inherit;
  color: inherit;
  opacity: 1;
  line-height: inherit;
  transform: none;
}

/* ── Nav: красивая стрелка-разделитель ── */
.about-nav .brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}
.about-nav .brand span {
  font-size: 20px;
  opacity: .8;
  transform: none;
}

/* ── Nav: стрелка-разделитель ── */
.about-nav .brand span {
  display: inline-block;
  font-size: 16px;
  opacity: .55;
  transform: none;
  margin: 0 6px;
}

/* ===== Typography ===== */
h1 {
  margin: 0 0 10px;
  font-size: clamp(24px, 5vw, 30px);
  font-weight: 700;
  letter-spacing: -.03em;
  color: #eef2f7;
}
.subtitle, .hint {
  color: var(--muted);
  line-height: 1.55;
}
.subtitle {
  margin: 0 auto 24px;
  max-width: 380px;
  font-size: 15px;
}

/* ===== QR View ===== */
.qr-view {
  min-height: 320px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 17px;
  color: var(--muted);
}
.qr-view img {
  width: min(260px, 78vw);
  padding: 14px;
  border-radius: 16px;
  background: #ffffff;
  box-shadow:
    0 16px 40px rgba(0, 0, 0, .4),
    0 0 60px rgba(52, 211, 153, .08);
  transition: transform .2s ease;
  /* Белый QR на тёмном фоне появляется плавно — без резкой вспышки. */
  animation: fade-in .35s ease-out;
}
.qr-view p { margin: 0; font-size: 14px; }

/* ===== Loader ===== */
.loader {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, .08);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }

/* ===== Status ===== */
.status {
  margin: 18px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}
.status.connected {
  color: #34d399;
}

/* ===== Drop Zone ===== */
.drop-zone {
  min-height: 180px;
  margin-top: 24px;
  display: grid;
  place-content: center;
  gap: 8px;
  border: 1.5px dashed rgba(255, 255, 255, .12);
  border-radius: 16px;
  color: #e0e0e0;
  cursor: pointer;
  background: rgba(255, 255, 255, .02);
  transition: all .25s ease;
}
.drop-zone:hover,
.drop-zone.over {
  border-color: var(--accent);
  background: var(--accent-glow);
  box-shadow: 0 0 40px rgba(52, 211, 153, .08);
}
.drop-zone:hover strong,
.drop-zone.over strong {
  color: var(--accent);
}
.drop-zone strong {
  font-size: 16px;
  font-weight: 600;
  transition: color .25s ease;
}
/* Нижняя надпись «или нажмите для выбора» приклеена к верхней строке:
   блок остаётся под верхним текстом, но наследует его цвет (включая
   акцент при наведении), размер и жирность. */
.drop-zone strong .sub {
  display: block;
}
.drop-zone input { display: none; }
.drop-zone .hint {
  margin: 2px 0 0;
  font-size: 12px;
  opacity: .5;
}

/* ===== Chat / File List ===== */
.transfer-view {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.chat {
  position: relative;
  /* Единая высота всех карточек чата: миниатюра 56px + паддинги 20px + рамка 2px. */
  --chat-card-h: 78px;
  /* Список тянется по фактическому числу файлов: без минимальной высоты окно
     не раздувается «на 3–4 файла», когда файл один. Прокрутка появляется,
     только когда контент упирается в max-height карточки. */
  flex: 0 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 18px 0 0;
  text-align: left;
}
/* Плавное растворение списка у краёв: маска делает сами буквы прозрачными
   у границы, поэтому контент не просвечивает через полупрозрачный слой. */
.chat.has-scroll .file-list {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
  /* Ползунок появился — карточки сжимаются и освобождают ему место. */
  padding-right: 14px;
}

.file-list {
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  /* Постоянного отступа справа нет: пока прокрутки нет, карточки занимают
     всю ширину. Место под ползунок освобождается только в .has-scroll. */
  padding: 4px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(52, 211, 153, .25) transparent;
}
.file-list::-webkit-scrollbar { width: 6px; }
.file-list::-webkit-scrollbar-track { background: transparent; }
.file-list::-webkit-scrollbar-thumb { background: rgba(52, 211, 153, .25); border-radius: 3px; }

.file-item {
  margin: 8px 0;
  /* min-height вытягивает карточки ошибок (они без миниатюры) до высоты
     обычных карточек. */
  min-height: var(--chat-card-h);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #d0d8e4;
  font-size: 14px;
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
  animation: file-in .25s ease-out;
  transition: background .2s ease;
}
.file-item:hover {
  background: rgba(255, 255, 255, .06);
}
/* Файл скачивается кликом по любому месту карточки — курсор-рука. */
.file-item.downloadable {
  cursor: pointer;
}
.file-item::before {
  content: '✓';
  order: 3;
  flex: 0 0 auto;
  margin-left: auto;
  color: #34d399;
  font-weight: 700;
}
/* Файл готов к скачиванию: стрелочка вниз в кружочке. После клика-скачивания
   карточка получает .downloaded — вместо стрелки появляется галочка ✓. */
.file-item.downloadable::before {
  content: '';
  width: 20px;
  height: 20px;
  background: var(--muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 8v7'/%3E%3Cpath d='m8.5 11.5 3.5 3.5 3.5-3.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 8v7'/%3E%3Cpath d='m8.5 11.5 3.5 3.5 3.5-3.5'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: background .2s ease;
}
/* Зелёная заливка стрелочки — только пока файл не скачан. Раньше правило
   цеплялось и к скачанным карточкам: у них ::before — текстовая галочка
   с width:auto, и при наведении вокруг ✓ появлялся зелёный прямоугольник. */
.file-item.downloadable:not(.downloaded):hover::before {
  background: var(--accent);
}
.file-item.pending::before {
  content: '';
  width: 16px;
  height: 16px;
  background: none;
  -webkit-mask: none;
  mask: none;
  border: 2px solid rgba(52, 211, 153, .2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
/* При наведении на карточку значок загрузки становится ярче-зелёным. */
.file-item.pending:hover::before {
  border-top-color: #6ee7b7;
}
.file-item.sending::before {
  content: '';
  width: 14px;
  height: 14px;
  background: none;
  -webkit-mask: none;
  mask: none;
  border: 2px solid rgba(255, 255, 255, .15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
/* Приём файла (из Telegram или напрямую P2P) — такой же вращающийся
   индикатор, как при отправке: сразу видно, что передача идёт. */
.file-item.receiving::before {
  content: '';
  width: 14px;
  height: 14px;
  background: none;
  -webkit-mask: none;
  mask: none;
  border: 2px solid rgba(255, 255, 255, .15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.file-item.downloaded::before {
  content: '✓';
  width: auto;
  height: auto;
  background: none;
  -webkit-mask: none;
  mask: none;
  color: #34d399;
  transition: color .2s ease;
}
.file-item.downloaded:hover::before {
  background: none;
  color: #6ee7b7;
}
@keyframes file-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.file-item.error {
  color: #f87171;
  border-color: rgba(248, 113, 113, .2);
  background: rgba(248, 113, 113, .08);
}
/* Восклицательный знак в треугольнике вместо крестика-«закрыть». */
.file-item.error::before {
  content: '';
  width: 16px;
  height: 16px;
  background: #f87171;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ===== Thumbnails ===== */
.file-thumb {
  order: 1;
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.file-thumb.photo img {
  display: block;
  max-width: 56px;
  max-height: 56px;
  width: auto;
  height: auto;
  border-radius: 8px;
}
.file-thumb.icon {
  gap: 2px;
  color: var(--accent-soft);
}
.file-thumb.icon svg {
  width: 32px;
  height: 32px;
  opacity: .85;
}
.file-thumb.icon .ext {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
}
.file-body {
  order: 2;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}
.file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-item a.file-name {
  color: var(--accent-soft);
  text-decoration: none;
  font-weight: 600;
  transition: color .2s ease;
}
.file-item a.file-name:hover {
  color: #ffffff;
  text-decoration: underline;
}
.file-meta {
  display: flex;
  gap: 10px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  /* Одна строка с многоточием: длинные заметки не вытягивают карточку
     в высоту, все карточки чата остаются одного размера. */
  white-space: nowrap;
}
.file-meta .file-size { flex: 0 0 auto; }
.file-meta .file-note {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-item.error .file-meta {
  color: #f87171;
}

/* ===== Button ===== */
.button {
  border: 0;
  border-radius: 12px;
  padding: 12px 20px;
  color: #ffffff;
  font-weight: 600;
  font-size: 14px;
  background: linear-gradient(135deg, rgba(52, 211, 153, .2), rgba(34, 180, 120, .15));
  border: 1px solid rgba(52, 211, 153, .2);
  cursor: pointer;
  transition: all .2s ease;
}
.button:hover {
  background: linear-gradient(135deg, rgba(52, 211, 153, .3), rgba(34, 180, 120, .25));
  border-color: rgba(52, 211, 153, .35);
  box-shadow: 0 0 20px rgba(52, 211, 153, .1);
}

/* ===== Hint ===== */
.hint {
  margin: 24px 0 0;
  font-size: 12px;
  opacity: .6;
}

/* ===== Site footer ===== */
.site-footer {
  margin-top: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
}
.site-footer a { color: var(--accent-soft); text-decoration: none; }
.site-footer a:hover { color: #ffffff; }

/* ===== About page: полноэкранный лендинг без ограничивающей карточки ===== */
body.about-page {
  display: block;
  min-height: 100vh;
  padding: 0;
  background-image:
    radial-gradient(ellipse 60% 45% at 12% -5%, rgba(52, 211, 153, .1) 0%, transparent 60%),
    radial-gradient(ellipse 45% 35% at 92% 12%, rgba(34, 180, 120, .06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 50% 115%, rgba(52, 211, 153, .07) 0%, transparent 60%);
}
html { scroll-behavior: smooth; }
#how { scroll-margin-top: 90px; }

.about-wrap { width: min(100% - 48px, 1100px); margin-inline: auto; }

/* ── Nav ── */
.about-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  width: 100%;
  min-height: 72px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 18px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, .7);
  backdrop-filter: blur(18px);
}
.about-nav .brand {
  white-space: nowrap;
  justify-content: center;
}
.about-nav .brand { margin: 0; }
.about-nav { min-height: 64px; }
.nav-cta {
  padding: 11px 18px;
  border-radius: 11px;
  color: #06120d;
  background: var(--accent);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}
.nav-cta:hover {
  background: var(--accent-soft);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(52, 211, 153, .28);
}

/* ── Hero ── */
.hero { padding: clamp(64px, 11vh, 120px) 0 clamp(40px, 7vh, 80px); max-width: 820px; }
.kicker {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 0;
  font-size: clamp(38px, 6.5vw, 68px);
  line-height: 1.02;
  letter-spacing: -.05em;
  color: #eef2f7;
}
.hero h1 em { color: var(--accent-soft); font-style: normal; }
.hero .lead {
  margin: 24px 0 0;
  max-width: 640px;
  color: #a6b3c1;
  font-size: clamp(16px, 2vw, 18px);
  line-height: 1.65;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-facts {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  margin: 46px 0 0;
  padding: 0;
  border-top: 1px solid var(--border);
}
.hero-facts li { flex: 1 1 auto; padding: 20px 24px 0 0; display: grid; gap: 4px; }
.hero-facts li + li { border-left: 1px solid var(--border); padding-left: 24px; }
.hero-facts strong { color: var(--accent-soft); font-size: 22px; letter-spacing: -.02em; }
.hero-facts span { color: var(--muted); font-size: 12px; }

/* ── Sections ── */
.section { padding: clamp(36px, 6vh, 64px) 0; }
.section h2 {
  margin: 0 0 32px;
  font-size: clamp(26px, 4vw, 36px);
  letter-spacing: -.03em;
  color: #eef2f7;
}

/* ── Steps ── */
.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 0;
  padding: 0;
}
.steps li {
  padding: 26px 24px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 18px;
  background: rgba(255, 255, 255, .025);
}
.step-num {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #06120d;
  background: var(--accent);
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(52, 211, 153, .25);
}
.steps h3 { margin: 20px 0 8px; color: #eef2f7; font-size: 17px; }
.steps p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

/* ── Features ── */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.feature-card {
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 18px;
  background: rgba(255, 255, 255, .025);
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}
.feature-card:hover {
  border-color: rgba(52, 211, 153, .3);
  background: rgba(52, 211, 153, .05);
  transform: translateY(-3px);
}
.feature-ico {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(52, 211, 153, .25);
  border-radius: 12px;
  background: rgba(52, 211, 153, .08);
  color: var(--accent-soft);
  font-size: 19px;
}
.feature-card h3 { margin: 18px 0 8px; color: #eef2f7; font-size: 16px; }
.feature-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

/* ── Privacy checklist ── */
.check-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 32px;
  margin: 0;
  padding: 0;
}
.check-list li {
  position: relative;
  padding-left: 30px;
  color: #a6b3c1;
  font-size: 14px;
  line-height: 1.6;
}
.check-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-weight: 800;
}

/* ── FAQ ── */
.faq details {
  padding: 0 22px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 14px;
  background: rgba(255, 255, 255, .02);
}
.faq details + details { margin-top: 10px; }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 0;
  cursor: pointer;
  color: #eef2f7;
  font-size: 15px;
  font-weight: 600;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--accent); font-size: 22px; font-weight: 700; line-height: 1; }
.faq details[open] summary::after { content: '–'; }
.faq details p { margin: 0 0 18px; color: var(--muted); font-size: 14px; line-height: 1.65; }

/* ── Final CTA ── */
.final-cta {
  margin-top: clamp(24px, 5vh, 48px);
  padding: clamp(36px, 6vw, 64px) 24px;
  text-align: center;
  border: 1px solid rgba(52, 211, 153, .25);
  border-radius: 28px;
  background:
    radial-gradient(ellipse 60% 80% at 50% 0%, rgba(52, 211, 153, .12) 0%, transparent 70%),
    rgba(255, 255, 255, .02);
  box-shadow: 0 0 90px rgba(52, 211, 153, .06);
}
.final-cta h2 {
  margin: 0 0 10px;
  font-size: clamp(24px, 4vw, 32px);
  letter-spacing: -.03em;
  color: #eef2f7;
}
.final-cta p { margin: 0 auto 28px; max-width: 460px; color: var(--muted); font-size: 15px; line-height: 1.6; }

/* ── Buttons ── */
.about-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: 12px;
  color: #06120d;
  background: var(--accent);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(52, 211, 153, .2);
  transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}
.about-button span { font-size: 16px; }
.about-button .btn-arrow {
  width: 16px;
  height: 16px;
  flex: none;
  transition: transform .2s ease;
}
.about-button:hover .btn-arrow { transform: translateX(3px); }
.about-button.big .btn-arrow { width: 17px; height: 17px; }
.about-button:hover {
  background: var(--accent-soft);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(52, 211, 153, .3);
}
.about-button.big { padding: 16px 30px; font-size: 15px; border-radius: 13px; }
.ghost-button {
  display: inline-flex;
  align-items: center;
  padding: 14px 22px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: #d0d8e4;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.ghost-button:hover {
  color: #ffffff;
  border-color: rgba(52, 211, 153, .4);
  background: rgba(52, 211, 153, .06);
}

/* ── Footer ── */
.about-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: clamp(40px, 8vh, 72px);
  padding: 26px 0 36px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}
.about-footer a { color: var(--accent-soft); text-decoration: none; }
.about-footer a:hover { color: #ffffff; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .steps, .feature-grid { grid-template-columns: 1fr; }
  .check-list { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .about-wrap { width: min(100% - 32px, 1100px); }
  .about-nav {
    padding: 16px 24px;
    min-height: 64px;
  }
  .about-nav .brand { font-size: 10px; letter-spacing: .16em; }
  .about-button span { display: none; }
  .hero-facts { flex-direction: column; }
  .hero-facts li { padding: 14px 0 0; }
  .hero-facts li + li { border-left: 0; border-top: 1px solid var(--border); padding-left: 0; margin-top: 14px; }
}

/* ===== Modal: подтверждение повторного скачивания ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(8px);
  animation: fade-in .18s ease;
}
.modal {
  width: min(100%, 340px);
  padding: 26px 24px 22px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  text-align: center;
  animation: pop-in .18s ease;
}
.modal-title {
  margin: 0 0 6px;
  color: #eef2f7;
  font-size: 16px;
  font-weight: 700;
}
.modal-file {
  margin: 0 0 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 13px;
}
.modal-actions {
  display: flex;
  gap: 10px;
}
.modal-actions .button,
.modal-cancel {
  flex: 1;
  padding: 12px 16px;
}
.modal-cancel {
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  background: transparent;
  cursor: pointer;
  transition: all .2s ease;
}
.modal-cancel:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .04);
}

/* ===== Drag-to-scroll: листание чата зажатой мышью ===== */
body.dragging-scroll,
body.dragging-scroll * {
  cursor: grabbing !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== Mode switch: Telegram / Между устройствами ===== */
.mode-switch {
  margin: 0 auto 22px;
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, .03);
}
.mode-switch a {
  padding: 10px 16px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s ease, background .2s ease;
}
.mode-switch a:hover { color: #e8eef5; }
.mode-switch a.active {
  color: #06120c;
  background: linear-gradient(135deg, var(--accent), #2bb585);
}

/* ===== Room: канал сайт↔сайт ===== */
/* Экран канала по высоте совпадает с QR-экраном Telegram: QR чуть меньше,
   под ним код и поле ввода — всё укладывается в те же 320px. */
.qr-view img.room-qr { width: min(170px, 50vw); }
.room-code {
  color: var(--accent-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: .3em;
  margin-right: -.3em; /* компенсация трекинга после последней буквы */
}
.room-code-input {
  width: 210px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, .03);
  color: #f4f7fb;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;
  letter-spacing: .3em;
  text-align: center;
  text-transform: uppercase;
  outline: none;
  transition: border-color .2s ease, background .2s ease;
}
.room-code-input:focus {
  border-color: rgba(52, 211, 153, .45);
  background: rgba(52, 211, 153, .05);
}
.room-code-input::placeholder {
  color: var(--muted);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
}
.room-create { margin-top: 4px; }
.room-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.room-actions .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  text-decoration: none;
}

/* ===== Responsive: удалено — см. блок МОБИЛЬНАЯ ВЕРСИЯ в конце файла ===== */

/* ===== Text compose: текст с сайта уходит сообщением от бота ===== */
.text-compose {
  margin-top: 12px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.text-compose textarea {
  flex: 1 1 auto;
  min-width: 0;
  resize: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, .03);
  color: #f4f7fb;
  font: inherit;
  font-size: 14px;
  line-height: 1.45;
  max-height: 132px;
  outline: none;
  transition: border-color .2s ease, background .2s ease;
}
.text-compose textarea:focus {
  border-color: rgba(52, 211, 153, .45);
  background: rgba(52, 211, 153, .05);
}
.text-compose textarea::placeholder { color: var(--muted); }
.text-send {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 12px;
  color: var(--accent);
  background: rgba(52, 211, 153, .08);
  cursor: pointer;
  transition: all .2s ease;
}
.text-send:hover {
  color: #ffffff;
  background: rgba(52, 211, 153, .16);
}
.text-send svg { width: 18px; height: 18px; }
/* Десктоп: у кнопки отправки стрелка вверх; «самолётик» остаётся на мобильном */
.text-send .ico-plane { display: none; }

/* ===== Mobile file button: скрыт по умолчанию, виден только на мобильном ===== */
.mobile-file-btn { display: none; }

/* ===== Text items: текст из чата на сайте, клик копирует ===== */
.text-item {
  margin: 8px 0;
  /* Фиксированная высота — ровно как у карточек файлов: длинный текст
     обрезается по двум строкам, все карточки чата остаются одного размера. */
  height: var(--chat-card-h);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
  cursor: pointer;
  animation: file-in .25s ease-out;
  transition: background .2s ease;
}
.text-item:hover { background: rgba(255, 255, 255, .06); }
.text-body {
  order: 2;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}
.text-content {
  white-space: pre-wrap;
  word-break: break-word;
  color: #d0d8e4;
  font-size: 14px;
  line-height: 1.5;
  display: -webkit-box;
  /* Две строки: карточка текста фиксированной высоты, как у файлов. */
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.text-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}
/* Иконка «копировать» справа; при ошибке — восклицательный знак. */
.text-item::before {
  content: '';
  order: 3;
  flex: 0 0 auto;
  margin-left: auto;
  width: 16px;
  height: 16px;
  background: var(--muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='12' height='12' rx='2'/%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='12' height='12' rx='2'/%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: background .2s ease;
}
.text-item:hover::before { background: var(--accent-soft); }
.text-item.sending::before {
  width: 14px;
  height: 14px;
  background: none;
  -webkit-mask: none;
  mask: none;
  border: 2px solid rgba(255, 255, 255, .15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.text-item.error {
  border-color: rgba(248, 113, 113, .2);
  background: rgba(248, 113, 113, .08);
}
.text-item.error .text-content,
.text-item.error .text-meta { color: #f87171; }
.text-item.error::before {
  background: #f87171;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E") center / contain no-repeat;
}
/* Отзыв после копирования: галочка вместо иконки «копировать». */
.text-item.copied::before {
  content: '✓';
  width: auto;
  height: auto;
  background: none;
  -webkit-mask: none;
  mask: none;
  color: #34d399;
  font-weight: 700;
}

/* ================================================================
   МОБИЛЬНАЯ ВЕРСИЯ — мессенджер: полноэкранный экран, ввод внизу
   ================================================================ */
@media (max-width: 540px) {
  /* ── Подложка: убираем фон, градиенты, сетку-центрирование ── */
  body {
    display: block;
    background: #000000;
    background-image: none;
    padding: 0;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  }
  /* Страница-«приложение» не скроллится целиком: скролл-рестор Chrome больше
     не уводит шапку под адресную строку. About-страница скроллится как обычно. */
  body:not(.about-page) {
    position: fixed;
    inset: 0;
    overflow: hidden;
    overscroll-behavior: none;
  }

  /* Точки-частицы невидимы на мобильном */
  .particles { display: none; }

  /* ── Карточка → полноэкранный flex-контейнер ── */
  .card {
    width: 100%;
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    border: none;
    border-radius: 0;
    background: #000000;
    box-shadow: none;
    backdrop-filter: none;
    padding: 0;
    text-align: left;
    animation: none;
    overflow: hidden;
  }
  .card:hover { box-shadow: none; }
  .card > * { animation: none !important; }

  /* ── Шапка: компактная + отступ от адресной строки Chrome ── */
  .brand {
    margin: 0;
    padding: max(10px, env(safe-area-inset-top)) 16px 10px;
    justify-content: center;
    font-size: 10px;
    letter-spacing: .18em;
  }
  .brand span { font-size: 14px; transform: none; }

  h1 {
    margin: 0;
    padding: 6px 16px 0;
    font-size: 20px;
  }
  /* Шапку страницы передачи центрируем; about-страница (.card там нет)
     остаётся с прежним левым выравниванием. */
  .card h1 { text-align: center; }
  .card .subtitle { text-align: center; }
  .subtitle {
    margin: 0 auto;
    padding: 2px 16px 6px;
    font-size: 13px;
  }

  /* ── Переключатель режимов: «Telegram / Между устройствами» по центру.
     Раньше inline-flex-навигация прижималась к левому краю: на мобильном
     карточка выравнивает текст влево, а auto-маржины на inline-блоке
     не работают. Блочный flex с шириной по содержимому центрируется. ── */
  .mode-switch {
    display: flex;
    width: fit-content;
    margin: 6px auto 8px;
  }
  .mode-switch a {
    padding: 8px 12px;
    font-size: 12px;
  }

  /* ── QR ── */
  .qr-view {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0 16px;
  }
  .qr-view img {
    width: min(200px, 65vw);
    padding: 10px;
    border-radius: 14px;
  }

  /* ── Transfer view: растягивается на остаток высоты ── */
  .transfer-view {
    flex: 1 1 0%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .status {
    margin: 6px 16px;
    font-size: 13px;
  }

  /* ── Drop zone: скрыт на мобильном (загрузка через 📎 внизу) ── */
  .drop-zone { display: none !important; }

  /* ── Чат: заполняет пространство над панелью ввода ── */
  .chat {
    flex: 1 1 0%;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    margin: 0;
    padding: 8px 12px;
    /* Панель ввода фиксирована внизу и растёт на iPhone-«home»: запас
       должен покрывать и её высоту, и safe-area, иначе последние карточки
       прячутся под панель. */
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
    scrollbar-width: none;
  }
  .chat::-webkit-scrollbar { display: none; }
  .chat.has-scroll { padding-right: 12px; }

  .chat.has-scroll .file-list {
    -webkit-mask-image: none;
    mask-image: none;
    padding-right: 0;
  }

  .file-list {
    scrollbar-width: none;
    overflow-y: visible;
  }
  .file-list::-webkit-scrollbar { display: none; }

  .file-item {
    margin: 6px 0;
    min-height: 64px;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
  }
  .file-thumb { width: 48px; height: 48px; }
  .file-thumb.photo img { max-width: 48px; max-height: 48px; }
  .file-thumb.icon svg { width: 26px; height: 26px; }

  .text-item {
    height: auto;
    min-height: 64px;
    padding: 8px 12px;
    margin: 6px 0;
    border-radius: 10px;
  }

  /* ══════════════════════════════════════════════════════════════
     НИЖНЯЯ ПАНЕЛЬ ВВОДА — position:fixed, всегда внизу экрана
     ══════════════════════════════════════════════════════════════ */
  .text-compose {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    background: rgba(18, 18, 18, .98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    margin: 0;
  }

  /* Кнопка «Прикрепить файл» — слева */
  .mobile-file-btn {
    display: grid !important;
    place-items: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--accent-soft);
    background: rgba(255, 255, 255, .04);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-file-btn:active {
    background: rgba(52, 211, 153, .15);
    border-color: rgba(52, 211, 153, .3);
  }
  .mobile-file-btn svg { width: 20px; height: 20px; }

  /* Текстовое поле: скруглённый «пузырь», растягивается вверх */
  .text-compose textarea {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 42px;
    max-height: 120px;
    height: 42px;
    padding: 10px 14px;
    border-radius: 21px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .06);
    color: #f4f7fb;
    font-size: 16px;
    line-height: 1.4;
    resize: none;
    overflow-y: hidden;
    -webkit-appearance: none;
    appearance: none;
    field-sizing: content;
  }
  .text-compose textarea::-webkit-scrollbar { display: none; }
  .text-compose textarea::placeholder { color: var(--muted); opacity: .7; }
  .text-compose textarea:focus {
    border-color: rgba(52, 211, 153, .4);
    background: rgba(255, 255, 255, .08);
  }

  /* Кнопка «Отправить» — круглая зелёная */
  .text-send {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: #06120d;
  }
  .text-send:active {
    background: var(--accent-soft);
    transform: scale(.95);
  }
  .text-send svg { width: 18px; height: 18px; }
  /* На мобильном — прежний «самолётик», стрелка не нужна */
  .text-send .ico-plane { display: block; }
  .text-send .ico-arrow { display: none; }

  /* Footer: скрыт */
  .site-footer { display: none !important; }
}
