/*
 * СВОИ попутчики — та же айдентика, что у сайта svoivezde.com:
 * три цвета (ink — система, paper — страница, blue — человеческая отметка),
 * Geologica для текста, JetBrains Mono для служебных подписей капсом,
 * синий маркер за словом, «бумажные» отпечатки с тенью и лёгким наклоном.
 * Никаких новых цветов: светлые плашки и линии — это ink с прозрачностью.
 * Источник правды — svoi-vezde-web/src/app/globals.css.
 */

@font-face {
  font-family: 'Geologica';
  src: url('../assets/fonts/geologica-cyrillic-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Geologica';
  src: url('../assets/fonts/geologica-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Caveat — рукописный, для подписи на обороте фото (OFL, assets/fonts/CAVEAT-OFL.txt) */
@font-face {
  font-family: 'Caveat';
  src: url('../assets/fonts/caveat-cyrillic-500-normal.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Caveat';
  src: url('../assets/fonts/caveat-latin-500-normal.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../assets/fonts/jetbrains-mono-cyrillic-wght-normal.woff2') format('woff2');
  font-weight: 100 800;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../assets/fonts/jetbrains-mono-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 800;
  font-display: swap;
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Токены. --bg/--ink/--muted/--tint/--line в тёмной теме Telegram подменяет js/platform */
:root {
  --bg: #ffffff;
  --ink: #0b0b0c;
  --muted: #5c5c5e;
  --blue: #0064fd;
  --blue-press: #0050cc;
  --on-blue: #ffffff;
  --paper: #ffffff; /* бумага отпечатков и логотипа — белая в любой теме */
  --tint: rgb(11 11 12 / 0.05);
  --line: rgb(11 11 12 / 0.12);
  --rule: var(--ink);

  --f: 'Geologica', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  /* мазок маркера с сайта (.title-mark-line) */
  --marker: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 40' preserveAspectRatio='none'%3E%3Cpath d='M5 9C40 4 92 6 150 3c20-1 37 1 45 4 4 9 2 19 3 27-38 4-96 3-150 5-18 1-33 0-44-2-3-9-2-19 1-28z' fill='%230064fd'/%3E%3C/svg%3E");

  color-scheme: light;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  min-height: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
}
img {
  max-width: 100%;
}
[hidden] {
  display: none !important;
}
a {
  color: inherit;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  text-align: inherit;
}
:is(button, a, input, select, textarea, label):focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
::selection {
  background: var(--blue);
  color: var(--on-blue);
}

.app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100%;
  padding: 0 16px 110px;
}
svg.i {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* служебная подпись: моно, капс, разрядка — как t-label на сайте */
.label,
.q > h2,
.meta,
.demo {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.05em;
  font-weight: 500;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

/* синий маркер за словом: каждая строка получает свой мазок */
.mark {
  color: var(--on-blue);
  background: var(--marker) center / 100% 100% no-repeat;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  padding: 0.04em 0.2em 0.08em;
}

/* Отпечаток фото — как на сайте svoivezde.com (Photo frame="print" lift):
   белая бумага со срезанным краем, небольшой наклон и мягкая тень, будто
   снимок лежит над страницей. Тень — на внешней обёртке: срез края
   (clip-path) на той же обёртке обрезал бы её. Наведение или нажатие
   выпрямляет снимок */
.print-photo {
  --tilt: 2.5deg;
  margin: 0;
  rotate: var(--tilt);
  filter: drop-shadow(0 1px 1px rgb(11 11 12 / 0.14)) drop-shadow(0 4px 8px rgb(11 11 12 / 0.06))
    drop-shadow(0 16px 30px rgb(11 11 12 / 0.09));
  transition: rotate 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  animation: print-settle 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  -webkit-tap-highlight-color: transparent;
}
.print-photo:hover,
.print-photo:active {
  rotate: 0deg;
}
/* снимок «ложится» на страницу при открытии экрана */
@keyframes print-settle {
  from {
    opacity: 0;
    rotate: calc(var(--tilt) + 5deg);
    translate: 0 10px;
  }
}
.print {
  background: var(--paper);
  padding: 3.5% 3.5% 5%;
  clip-path: polygon(0.6% 1.4%, 41% 0.3%, 99.3% 0, 100% 97.6%, 57% 99.7%, 0 100%);
}
.print img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- шапка ---------- */
.top {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 5;
  background: var(--bg);
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  margin-inline: -16px;
  padding-inline: 16px;
  border-bottom: 1px solid var(--line);
}
/* логотип на кусочке бумаги, чуть заходит за линию шапки — как на сайте */
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #0b0b0c;
  rotate: -1.5deg;
  translate: 0 6px;
  filter: drop-shadow(0 1px 1px rgb(11 11 12 / 0.16)) drop-shadow(0 6px 14px rgb(11 11 12 / 0.08));
}
.logo span {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--paper);
  padding: 6px 12px 6px 6px;
  clip-path: polygon(0.6% 1.4%, 41% 0.3%, 99.3% 0, 100% 97.6%, 57% 99.7%, 0 100%);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.logo img {
  width: 28px;
  height: 28px;
  display: block;
}
.top .sp {
  flex: 1;
}
/* живой счётчик сообщества */
.count {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
  min-height: 44px;
  white-space: nowrap;
}
.count i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 0 rgb(0 100 253 / 0.5);
  animation: live 2.4s ease-out infinite;
}
.count b {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink);
}
@keyframes live {
  0% {
    box-shadow: 0 0 0 0 rgb(0 100 253 / 0.45);
  }
  70%,
  100% {
    box-shadow: 0 0 0 8px rgb(0 100 253 / 0);
  }
}

/* ---------- заголовки экранов ---------- */
.hero,
.ph {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34%;
  gap: 4px 16px;
  align-items: center;
  margin-top: 28px;
}
.hero h1,
.ph h1 {
  grid-column: 1 / -1;
}
.hero h1,
.ph h1 {
  margin: 0;
  font-size: clamp(36px, 11vw, 52px);
  line-height: 0.92;
  letter-spacing: -0.05em;
  font-weight: 760;
}
.hero h1 .mark,
.ph h1 .mark {
  display: inline-block;
  margin-top: 0.08em;
}
.hero p,
.ph p {
  grid-column: 1;
  grid-row: 2;
  margin: 8px 0 0;
  font-size: 18px;
  line-height: 1.38;
  letter-spacing: -0.012em;
  max-width: 30ch;
}
.hero .print-photo,
.ph .print-photo {
  grid-column: 2;
  grid-row: 2;
}

/* ---------- блоки ---------- */
.q {
  margin-top: 32px;
}
.q > h2 {
  margin: 0 0 12px;
}
.lead {
  margin: 0;
  font-size: 17px;
  line-height: 1.45;
}
.note {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--muted);
}

/* направления: пронумерованный список, как «01 Бали» на главной сайта */
.dests {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.dest {
  display: grid;
  gap: 4px;
  align-content: start;
  min-height: 84px;
  padding-top: 10px;
  border-top: 1.5px solid var(--rule);
}
.dest small {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.dest b {
  justify-self: start;
  font-size: clamp(16px, 4.6vw, 22px);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 700;
}
.dest.sel {
  border-top-color: var(--blue);
}
.dest.sel b {
  color: var(--on-blue);
  background: var(--marker) center / 100% 100% no-repeat;
  padding: 0.07em 0.18em 0.06em;
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-inline: -16px;
  padding: 2px 16px 4px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar {
  display: none;
}
.chipwrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  flex: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 13px;
  border-radius: 3px;
  background: var(--bg);
  box-shadow: inset 0 0 0 1.5px var(--line);
  white-space: nowrap;
}
.chip.on {
  background: var(--blue);
  color: var(--on-blue);
  box-shadow: none;
}

.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1.5px solid var(--line);
}
.seg button {
  min-height: 48px;
  font-weight: 600;
  font-size: 15px;
  text-align: center;
  color: var(--muted);
  margin-bottom: -1.5px;
  border-bottom: 2px solid transparent;
}
.seg button.on {
  color: var(--ink);
  border-bottom-color: var(--blue);
}

/* моя поездка на экране поиска (даты меняются только в профиле) */
.mytrip {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: center;
  padding: 14px 0;
  border-block: 1.5px solid var(--rule);
}
.mytrip b {
  font-size: 18px;
  letter-spacing: -0.02em;
}
.mytrip .label {
  grid-column: 1;
}
.mytrip .go {
  grid-row: 1 / span 2;
  grid-column: 2;
}

/* ---------- формы ---------- */
.dates {
  display: grid;
  /* minmax(0, 1fr): поле даты не распирает колонку своей «родной» шириной,
     иначе второе поле вылезает вправо вместе с иконкой календаря */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
/* поля даты — одинаковые и выровненные по левому краю на всех телефонах */
.f input[type='date'] {
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  text-align: left;
}
.f input[type='date']::-webkit-date-and-time-value {
  text-align: left;
}
.f input[type='date']::-webkit-calendar-picker-indicator {
  margin-left: auto;
  padding: 0;
}
label.f {
  display: grid;
  gap: 6px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
input,
select,
textarea {
  font: 400 16px var(--f);
  letter-spacing: normal;
  text-transform: none;
  color: var(--ink);
  background-color: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 3px;
  padding: 11px 12px;
  min-height: 48px;
  width: 100%;
  min-width: 0;
}
textarea {
  resize: vertical;
}
:is(input, select, textarea):focus {
  border-color: var(--blue);
}
input:disabled {
  background: var(--tint);
  color: var(--muted);
}
.form,
.profile-form {
  display: grid;
  gap: 14px;
}

/* ---------- кнопки ---------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  width: 100%;
  padding: 0 16px;
  border-radius: 3px;
  background: var(--blue);
  color: var(--on-blue);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  text-align: center;
  text-decoration: none;
  transition: background 0.15s;
}
.btn:active {
  background: var(--blue-press);
}
.btn.line,
.btn.done {
  background: var(--bg);
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--ink);
}
.btn.done {
  color: var(--muted);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.btn.small {
  min-height: 44px;
  width: auto;
  font-size: 15px;
}
.btn[disabled] {
  opacity: 0.4;
}
.pair {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 8px;
}
/* текстовое действие с маркером, как CTA на сайте */
.go {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  color: var(--blue);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

/* ---------- списки: линейки вместо карточек ---------- */
.res-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 40px 0 4px;
}
.res-h h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1;
  font-weight: 720;
  letter-spacing: -0.04em;
}
.list {
  display: grid;
}
.card {
  display: grid;
  gap: 14px;
  padding: 18px 0 20px;
  border-top: 1.5px solid var(--rule);
}
.list > .card:first-child {
  margin-top: 12px;
}
.card h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.025em;
}
.who {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 14px;
  align-items: center;
}
.who .meta {
  margin-top: 4px;
}

/* аватар: фото или первая буква на синем */
.av {
  width: 60px;
  height: 60px;
  border-radius: 3px;
  background: var(--blue);
  color: var(--on-blue);
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}
.av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dl {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 15px;
}
.dl svg {
  width: 18px;
  height: 18px;
  color: var(--blue);
  flex: none;
}
.dl b {
  font-weight: 600;
}
.ok {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--on-blue);
  background: var(--marker) center / 100% 100% no-repeat;
  padding: 2px 7px 3px;
}
.about {
  margin: 0;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag {
  font-size: 13px;
  padding: 3px 9px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--muted);
}
.tag.match {
  box-shadow: none;
  background: var(--blue);
  color: var(--on-blue);
}

.empty {
  text-align: center;
  color: var(--muted);
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 24px 8px 12px;
}
.empty .mascot {
  width: 160px;
  height: auto;
}
.safe {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}
.safe svg {
  flex: none;
  color: var(--blue);
}

/* ссылки на сайт и в сообщество */
.links {
  display: grid;
  border-top: 1.5px solid var(--rule);
}
.links a {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.links b {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.links span {
  grid-column: 1;
  font-size: 14px;
  color: var(--muted);
}
.links i {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  font-style: normal;
  font-size: 20px;
  color: var(--blue);
  transition: translate 0.3s var(--ease);
}
.links a:active i {
  translate: 0.15em -0.15em;
}

/* ---------- планы: скоро ---------- */
.soon {
  display: inline-block;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--blue);
}

/* ---------- заявки ---------- */
.title {
  margin: 28px 0 0;
  font-size: clamp(36px, 11vw, 52px);
  line-height: 0.92;
  letter-spacing: -0.05em;
  font-weight: 760;
}
.tabs {
  margin-top: 20px;
}
.msg {
  margin: 0;
  padding: 10px 12px;
  border-left: 2px solid var(--blue);
  background: var(--tint);
}
.contact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
  font-weight: 600;
}
.contact-link {
  color: var(--blue);
  text-decoration: none;
}

/* ---------- профиль ---------- */
.me {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 16px;
  align-items: center;
  margin-top: 28px;
}
.me .av {
  width: 96px;
  height: 96px;
  font-size: 42px;
}
.me h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1;
  font-weight: 740;
  letter-spacing: -0.045em;
}
.me .label {
  margin: 8px 0 0;
}
.photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.photo-actions .btn {
  flex: 1 1 140px;
}
.photo-actions .go {
  color: var(--muted);
}
.trip {
  display: grid;
  gap: 10px;
  padding: 14px 0 16px;
  border-top: 1.5px solid var(--rule);
}
.trip-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.trip-h b {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.025em;
}
.trip p {
  margin: 0;
}
.trip .acts {
  display: flex;
  gap: 16px;
}
.trip .acts .go {
  min-height: 36px;
}
.trip .acts.confirm {
  align-items: center;
}
.trip .acts.confirm span {
  font-weight: 600;
}
.trip.hidden-trip b,
.trip.hidden-trip .dates-line {
  color: var(--muted);
}
/* рассказ о себе для этой поездки: в списке — три строки, целиком — в форме */
.trip .trip-about {
  white-space: pre-line;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.trip .trip-about.empty {
  color: var(--muted);
  font-size: 14px;
}
/* счётчик символов под полем: «120/300» */
label.f .count {
  justify-self: end;
  margin-top: -2px;
}
.rows {
  border-top: 1.5px solid var(--rule);
}
.rows button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  border-bottom: 1px solid var(--line);
  font-weight: 500;
}
.rows .v {
  color: var(--muted);
  font-size: 14px;
}

/* Сворачиваемый блок, как вопрос в FAQ: заголовок-кнопка со сводкой, по
   нажатию содержимое плавно раскрывается (grid 0fr → 1fr). Закрытое —
   inert: кнопки внутри не ловят фокус и нажатия */
.q > .fold-h {
  margin: 0;
}
.fold-h button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 4px 0;
  text-align: left;
  font: inherit;
  color: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
}
.chev {
  flex: none;
  width: 11px;
  height: 11px;
  margin-right: 4px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  rotate: 45deg;
  translate: 0 -3px;
  transition:
    rotate 0.3s var(--ease),
    translate 0.3s var(--ease);
}
.fold.open .chev {
  rotate: 225deg;
  translate: 0 3px;
}
.fold-body {
  display: grid;
  grid-template-rows: 0fr;
  visibility: hidden;
  transition:
    grid-template-rows 0.35s var(--ease),
    visibility 0s linear 0.35s;
}
.fold.open .fold-body {
  grid-template-rows: 1fr;
  visibility: visible;
  transition:
    grid-template-rows 0.35s var(--ease),
    visibility 0s;
}
.fold-in {
  min-height: 0;
  overflow: hidden;
}
.fold-in > :first-child {
  margin-top: 14px;
}
@media (prefers-reduced-motion: reduce) {
  .fold-body,
  .fold.open .fold-body,
  .chev {
    transition: none;
  }
}

/* ---------- нижнее меню ---------- */
.nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.nav .in {
  max-width: 520px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.nav button {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 8px 0 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  position: relative;
  text-align: center;
}
.nav svg {
  width: 24px;
  height: 24px;
}
.nav button.on {
  color: var(--blue);
}
.nav .soon {
  position: absolute;
  top: 3px;
  left: calc(50% + 10px);
}
.nb {
  position: absolute;
  top: 4px;
  left: calc(50% + 7px);
  min-width: 19px;
  height: 19px;
  border-radius: 10px;
  background: var(--blue);
  color: var(--on-blue);
  font-size: 11px;
  font-weight: 600;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border: 2px solid var(--bg);
}
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(86px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 20;
  background: var(--ink);
  color: var(--bg);
  padding: 12px 16px;
  border-radius: 3px;
  font-size: 14px;
  font-weight: 500;
  width: max-content;
  max-width: calc(100% - 32px);
  text-align: center;
}
.fade {
  animation: fade 0.2s var(--ease);
}
@keyframes fade {
  from {
    opacity: 0.4;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .fade,
  .count i {
    animation: none;
  }
}

/* доступность */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
[tabindex='-1']:focus {
  outline: none;
}

/* Telegram Mini App: классы tg и tg-dark ставит js/platform */
html.tg {
  --sa-top: calc(
    max(env(safe-area-inset-top, 0px), var(--tg-sa-top, 0px)) + var(--tg-csa-top, 0px)
  );
  --sa-bottom: calc(
    max(env(safe-area-inset-bottom, 0px), var(--tg-sa-bottom, 0px)) + var(--tg-csa-bottom, 0px)
  );
  padding-top: var(--sa-top);
  padding-bottom: var(--sa-bottom);
}
html.tg.tg-dark {
  color-scheme: dark;
  --rule: var(--muted);
}
html.tg body {
  min-height: var(--tg-vh-stable, 100vh);
}
html.tg .top {
  top: var(--sa-top);
}
/* весь экран: полоса под часами и кнопками Telegram — цвета фона, чтобы
   прокручиваемое не просвечивало над шапкой */
html.tg::before {
  content: '';
  position: fixed;
  inset: 0 0 auto;
  height: var(--sa-top);
  background: var(--bg);
  z-index: 6;
}
html.tg .nav {
  bottom: auto;
  top: var(--tg-vh-stable, 100vh);
  transform: translateY(-100%);
  padding-bottom: var(--sa-bottom);
}
html.tg .toast {
  bottom: auto;
  top: calc(var(--tg-vh-stable, 100vh) - 86px - var(--sa-bottom));
  transform: translate(-50%, -100%);
}

/* ---------- жалоба ---------- */
.report-link {
  justify-self: start;
  min-height: 36px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}
.report-form {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.report-form fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
  min-width: 0;
}
.report-form legend {
  padding: 0;
  margin-bottom: 6px;
  font-weight: 600;
}
.report-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  cursor: pointer;
}
.report-option input {
  flex: none;
  width: 20px;
  height: 20px;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--blue);
}
.report-note {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
/* абзацы подряд — с заметным отступом, иначе сливаются в один */
.report-note + .report-note,
.note + .note {
  margin-top: 10px;
}

/* ---------- согласие, «открой в Telegram», документы ---------- */
.consent {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}
.consent h1 {
  margin: 0;
  font-size: 34px;
  line-height: 0.95;
  font-weight: 740;
  letter-spacing: -0.045em;
}
.consent p {
  margin: 0;
}
.gate-delete {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  justify-items: start;
}
.consent-boxes {
  display: grid;
  border-top: 1.5px solid var(--rule);
}
.consent-box {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  font-size: 16px;
  line-height: 1.4;
}
.consent-box input {
  width: 22px;
  height: 22px;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--blue);
}
.consent-box .opt {
  display: block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.inline-link {
  display: inline;
  color: var(--blue);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.2em;
}
.open-tg a.btn {
  text-decoration: none;
}
.open-tg #open-tg-link:empty {
  display: none;
}
.legal {
  display: grid;
  gap: 10px;
  overflow-wrap: anywhere;
  margin-top: 24px;
}
.legal h1 {
  font-size: 30px;
  line-height: 1;
  font-weight: 740;
  letter-spacing: -0.04em;
  margin: 0 0 6px;
}
.legal h3 {
  font-size: 17px;
  margin: 14px 0 0;
  letter-spacing: -0.02em;
}
.legal p,
.legal ul {
  margin: 0;
}
.legal ul {
  padding-left: 20px;
}
.legal mark {
  background: var(--tint);
  color: inherit;
  padding: 0 3px;
}
.legal .ver {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.legal .btn {
  margin-top: 16px;
}

/* ---------- загрузка: «вода» заливает снизу вверх ---------- */
/* Фирменный приём: пока идёт действие, синяя вода с волной поднимается —
   быстро, потом всё медленнее, к ~90%. Готово — доливается до 100% (класс
   filled) и исчезает. Сколько осталось, мы не знаем, поэтому вода никогда
   не сбрасывается в начало */
:root {
  --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='8' viewBox='0 0 40 8'%3E%3Cpath d='M0 4 Q10 0 20 4 T40 4 V8 H0 Z'/%3E%3C/svg%3E");
}
:is(button, label, a).loading,
:is(button, label, a).filled {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  pointer-events: none;
}
:is(button, label, a).loading::before,
:is(button, label, a).filled::before {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  z-index: -1;
  height: 0;
  background: var(--water, var(--blue-press));
  -webkit-mask:
    var(--wave) 0 0 / 40px 8px repeat-x,
    linear-gradient(#000 0 0) 0 7px / 100% 100% no-repeat;
  mask:
    var(--wave) 0 0 / 40px 8px repeat-x,
    linear-gradient(#000 0 0) 0 7px / 100% 100% no-repeat;
  animation:
    water-rise 8s cubic-bezier(0.05, 0.75, 0.2, 1) forwards,
    water-wave 1.2s linear infinite;
}
:is(button, label, a).filled::before {
  animation:
    water-finish 0.4s ease-out forwards,
    water-wave 1.2s linear infinite;
}
/* у светлых кнопок вода светло-синяя, чтобы текст читался; у синей
   метки — светлая, иначе её не видно */
.btn.line.loading,
.btn.line.filled,
.chip.loading,
.chip.filled {
  --water: rgb(0 100 253 / 0.18);
}
.chip.on.loading,
.chip.on.filled {
  --water: rgb(255 255 255 / 0.28);
}
/* у метки рамка нарисована тенью внутри — вода идёт под рамкой, не поверх */
.chip.loading::before,
.chip.filled::before {
  inset: auto 1.5px 1.5px;
  border-radius: 0 0 1.5px 1.5px;
}

/* Текстовые кнопки («Изменить», «Скрыть фото»): у них нет своей формы, и
   прямоугольник воды за словом выглядел чужим. Вода наливается в сами буквы:
   слово бледнеет, и снизу вверх его заполняет синий. Уровень — по строке
   текста в середине кнопки, а не по всей высоте области нажатия */
.go.loading,
.go.filled {
  overflow: visible;
  background: linear-gradient(rgb(0 100 253 / 0.3) 50%, var(--blue) 50%) 0 24% / 100% 200% no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: text-rise 8s cubic-bezier(0.05, 0.75, 0.2, 1) forwards;
}
.go.filled {
  animation: text-finish 0.22s ease-out forwards;
}
.go.loading::before,
.go.filled::before {
  content: none;
}
@keyframes text-rise {
  from {
    background-position: 0 24%;
  }
  15% {
    background-position: 0 36%;
  }
  to {
    background-position: 0 47%;
  }
}
@keyframes text-finish {
  from {
    background-position: 0 45%;
  }
  to {
    background-position: 0 100%;
  }
}
@keyframes water-rise {
  from {
    height: 0;
  }
  15% {
    height: 70%;
  }
  to {
    height: 92%;
  }
}
/* долив до верха, затем вода мягко растворяется — кнопка не «щёлкает»
   обратно в свой цвет */
@keyframes water-finish {
  from {
    height: 85%;
  }
  55% {
    height: 115%;
    opacity: 1;
  }
  to {
    height: 115%;
    opacity: 0;
  }
}
@keyframes water-wave {
  to {
    -webkit-mask-position:
      40px 0,
      0 7px;
    mask-position:
      40px 0,
      0 7px;
  }
}

/* Свойсик «наливается»: бледный, а снизу вверх волной проявляется его
   настоящий цвет. Край — только волна, без прямой линии */
.fill-mascot {
  position: relative;
  display: inline-block;
  width: 120px;
}
.fill-mascot img {
  display: block;
  width: 100%;
  height: auto;
}
.fill-mascot .ghost {
  opacity: 0.22;
  filter: grayscale(1);
}
/* окно, которое поднимается снизу; верхний край окна — волна */
.fill-mascot .rise {
  position: absolute;
  inset: auto 0 0 0;
  height: 0;
  overflow: hidden;
  -webkit-mask:
    var(--wave) 0 0 / 40px 8px repeat-x,
    linear-gradient(#000 0 0) 0 7px / 100% 100% no-repeat;
  mask:
    var(--wave) 0 0 / 40px 8px repeat-x,
    linear-gradient(#000 0 0) 0 7px / 100% 100% no-repeat;
  animation:
    mascot-rise 8s cubic-bezier(0.05, 0.75, 0.2, 1) forwards,
    water-wave 1.2s linear infinite;
}
/* цветной Свойсик внутри окна стоит на месте — окно открывает его снизу */
.fill-mascot .rise img {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
}
.filled .fill-mascot .rise,
.fill-mascot.filled .rise {
  animation:
    mascot-finish 0.3s ease-out forwards,
    water-wave 1.2s linear infinite;
}
.splash.filled {
  opacity: 0;
  transition: opacity 0.25s 0.15s var(--ease);
}
@keyframes mascot-rise {
  from {
    height: 0;
  }
  15% {
    height: 70%;
  }
  to {
    height: 92%;
  }
}
@keyframes mascot-finish {
  from {
    height: 85%;
  }
  to {
    height: calc(100% + 8px);
  }
}
.loading-people {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 24px 0;
  color: var(--muted);
}

/* «Куда едешь?» со стрелкой к вариантам */
.ask span {
  display: inline-block;
  margin-left: 4px;
  animation: nudge 1.6s ease-in-out infinite;
}
@keyframes nudge {
  50% {
    transform: translateY(3px);
  }
}

/* «Это ты» в поиске */
.me-card {
  border-color: var(--blue);
}

/* Лечу / Уже здесь */
.seg-pick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 4px 0 12px;
}
.seg-opt {
  position: relative;
}
.seg-opt input {
  position: absolute;
  opacity: 0;
  inset: 0;
}
.seg-opt span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1.5px var(--line);
  font-weight: 600;
  transition:
    background 0.15s var(--ease),
    color 0.15s var(--ease);
}
.seg-opt input:checked + span {
  background: var(--ink);
  color: var(--bg);
  box-shadow: none;
}
.seg-opt input:focus-visible + span {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* свой интерес */
.other-f {
  margin-top: 12px;
}

/* плавные переключения чипов и стран без перерисовки экрана */
.chip,
.dest {
  transition:
    background 0.15s var(--ease),
    color 0.15s var(--ease),
    border-color 0.15s var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  .print-photo {
    animation: none;
    transition: none;
  }
  :is(button, label, a).loading::before,
  .ask span {
    animation: none;
  }
  :is(button, label, a).loading::before {
    height: 100%;
    opacity: 0.5;
  }
  .go.loading,
  .go.filled {
    animation: none;
    background-position: 0 50%;
  }
  .fill-mascot .rise {
    animation: none;
    height: calc(100% + 8px);
  }
}

/* Экран загрузки до первой отрисовки — прямо в index.html */
.splash {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 12px;
  min-height: 60vh;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.splash .fill-mascot {
  width: 140px;
}

.seg-pick.three {
  grid-template-columns: repeat(3, 1fr);
}
/* «Уже здесь / Лечу / Живу здесь» в поиске */
.stay-pick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.stay-pick .btn {
  min-height: 48px;
  font-size: 15px;
  padding: 0 6px;
}
/* метка местного */
.local-tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 3px;
  background: var(--blue);
  color: var(--on-blue);
  font-weight: 600;
}
/* анкета в поиске — наверху профиля */
.search-card {
  display: grid;
  gap: 10px;
  margin: 18px 0 6px;
  padding: 16px;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1.5px var(--line);
}
/* рамка синяя в обоих состояниях; видна анкета или нет — по слову в заголовке */
.search-card.on,
.search-card.off {
  box-shadow: inset 0 0 0 2px var(--blue);
}
.search-card h2 {
  margin: 0;
}
.search-card p {
  margin: 0;
}
.search-card .v {
  color: var(--muted);
}
.search-card .mark {
  display: inline-block;
  margin-left: 0.1em;
}

/* Пишешь — меню прячется, внизу запас, чтобы поле встало над клавиатурой */
body.typing .nav {
  display: none;
}
body.typing #view {
  padding-bottom: 45vh;
  transition: none;
}
/* Клавиатура закрылась — запас снизу уходит плавно, а не рывком: иначе
   страница, прокрученная к нижнему полю, прыгает вверх */
#view {
  transition: padding-bottom 0.35s var(--ease);
}

/* ---------- мастер знакомства ---------- */
/* Один вопрос на экран: сверху «Назад», номер шага и полоска прогресса,
   дальше крупный вопрос, большие варианты ответа и одна кнопка «Дальше» */
.ob {
  margin-top: 8px;
}
.ob-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
}
.ob-back {
  min-height: 44px;
}
.ob-bar {
  display: grid;
  grid-auto-flow: column;
  gap: 4px;
  margin-bottom: 10px;
}
.ob-bar span {
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  transition: background 0.3s var(--ease);
}
.ob-bar span.on {
  background: var(--blue);
}
.ob-opts {
  display: grid;
  gap: 8px;
}
.ob-opts.two {
  grid-template-columns: 1fr 1fr;
}
.ob-opt {
  min-height: 56px;
  padding: 0 18px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 2px var(--line);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-align: left;
  transition:
    box-shadow 0.15s,
    background 0.15s,
    color 0.15s;
}
.ob-opt.on {
  background: var(--blue);
  color: var(--on-blue);
  box-shadow: none;
}
.ob-photo {
  display: flex;
  align-items: center;
  gap: 14px;
}
.ob-photo .av {
  width: 84px;
  height: 84px;
  font-size: 36px;
  flex: none;
}
.ob-photo-acts {
  display: grid;
  gap: 8px;
  justify-items: start;
}
.ob .btn#ob-next {
  margin-top: 6px;
}
.ob .btn#ob-next:disabled {
  opacity: 0.4;
}
.ob-skip {
  justify-self: center;
}
.ob-field {
  display: grid;
  gap: 6px;
}
.ob-cap {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.ob-preview .card {
  margin: 0;
}
/* скрытая анкета: карточка бледная — так её сейчас никто не видит */
.ob-preview.dim .card {
  opacity: 0.45;
}

/* «Готово» над клавиатурой: закрыть её одним нажатием (на цифровой
   клавиатуре iPhone своей кнопки для этого нет). Положение по вертикали
   ставит js/ui/keyboard.js — у нижнего края видимой части экрана */
.kb-done {
  position: fixed;
  top: 0;
  right: 12px;
  z-index: 60;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 20px;
  background: var(--blue);
  color: var(--on-blue);
  font: 600 15px/1 var(--f);
  box-shadow: 0 4px 14px rgb(11 11 12 / 0.18);
}
.kb-done[hidden] {
  display: none;
}

/* без двойного касания для масштаба и без «резинового» сдвига экрана вбок */
html {
  touch-action: manipulation;
  overflow-x: hidden;
}
/* поля под тень у снимка выходят за край экрана: обрезаем их по краю,
   чтобы экран не сдвигался вбок */
body {
  overflow-x: clip;
}
/* и без «резинки» по горизонтали: экран не тянется вбок пальцем */
html,
body {
  overscroll-behavior-x: none;
}

/* ---------- фото переворачивается: на обороте подпись от руки ---------- */
/* Кнопка-снимок: нажатие переворачивает его, ещё раз — обратно.

   Бумага, срез края и тень запечены в картинки (assets/print-front.webp и
   print-back.webp — отрисованы из стилей .print-photo/.print). CSS-эффекты
   (clip-path, filter) Safari на iPhone сбрасывает на время 3D-поворота, и
   снимок мигал прямоугольником; картинка вертится целиком, как один предмет.
   Картинка больше снимка на поля под тень — отрицательные отступы
   выравнивают снимок по ячейке (проценты — от ширины снимка).

   Переворот в два полуоборота: лицо доворачивается до ребра, в этот миг
   стороны меняются, оборот разворачивается с лёгкой отдачей. Наклон
   постоянный: от касания снимок не выпрямляется */
button.print-photo {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  filter: none;
}
button.print-photo:hover,
button.print-photo:active {
  rotate: var(--tilt);
}
.print-photo .face {
  --half: 0.28s;
  display: block;
  transform: none;
  /* уход к ребру — разгоняясь; возврат — с отдачей; смена сторон — на ребре */
  transition:
    transform 0.42s cubic-bezier(0.25, 1.5, 0.5, 1) var(--half),
    visibility 0s linear var(--half);
}
.print-photo .sheet {
  display: block;
  width: 184.36%;
  max-width: none;
  height: auto;
  margin: -31.03% 0 -55.8% -42.18%;
  /* поля под тень не ловят нажатия: переворачивает только сам снимок */
  pointer-events: none;
}
.print-photo .back {
  position: absolute;
  inset: 0;
  visibility: hidden;
  transform: perspective(900px) rotateY(-90deg);
  transition:
    transform var(--half) cubic-bezier(0.55, 0, 0.9, 0.5),
    visibility 0s linear var(--half);
}
.print-photo.flipped .front {
  visibility: hidden;
  transform: perspective(900px) rotateY(90deg);
  transition:
    transform var(--half) cubic-bezier(0.55, 0, 0.9, 0.5),
    visibility 0s linear var(--half);
}
.print-photo.flipped .back {
  visibility: visible;
  transform: none;
  transition:
    transform 0.42s cubic-bezier(0.25, 1.5, 0.5, 1) var(--half),
    visibility 0s linear var(--half);
}
/* подпись лежит поверх бумаги оборота, по центру снимка */
.print-photo .back .verso {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  container-type: inline-size;
}
/* подпись синей ручкой: чуть наискосок, как пишут на обороте снимка */
.hand {
  font-family: 'Caveat', 'Comic Sans MS', cursive;
  font-weight: 500;
  font-size: 22px;
  font-size: 12.5cqw;
  line-height: 1.02;
  color: var(--blue);
  text-align: left;
  rotate: -5deg;
}
@media (prefers-reduced-motion: reduce) {
  .print-photo .face,
  .print-photo.flipped .face {
    transition: none;
  }
}

/* ---------- мягкий вид ---------- */
/* Приложение попутчиков — спокойное и тёплое: скруглённые кнопки и поля без
   чёрных рамок, мягкие плашки вместо линий. Всё, что выбирают (страна,
   район, интерес, вариант ответа), нарисовано мазком — как фирменный маркер
   в заголовках: серым, а выбранное — синим. Форма мазка у соседей чуть
   разная, ряд выглядит нарисованным от руки. Мазок — маска на ::after,
   поэтому цвет берётся из темы, а текст не обрезается */
:root {
  --soft: #f2f4f8;
  --line: rgb(11 11 12 / 0.08);
  --rule: rgb(11 11 12 / 0.1);
  --brush-tile-1: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M5 8C28 3 62 6 95 3c3 2 3 6 3 9 0 26-2 52 1 79 0 4-2 6-6 6-29 1-58-2-87 1-3 0-5-2-5-5 1-27 3-55 0-82 0-2 1-3 4-3z'/%3E%3C/svg%3E");
  --brush-tile-2: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M3 5c30 2 60-2 92 1 3 1 4 4 3 7-2 25 1 50-1 78 0 3-2 5-5 5-30-2-58 2-86-1-3 0-4-2-4-5 2-27-1-54 1-81 0-3-1-4 0-4z'/%3E%3C/svg%3E");
  --brush-tile-3: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M6 4c26 3 58 0 90 3 2 0 3 3 3 6-1 27 1 53-2 80-1 2-3 3-5 3-28-3-58 1-87-1-2 0-3-2-3-4 1-28-2-55 0-83 0-3 2-4 4-4z'/%3E%3C/svg%3E");
  --brush-wide-1: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 40' preserveAspectRatio='none'%3E%3Cpath d='M5 9C40 4 92 6 150 3c20-1 37 1 45 4 4 9 2 19 3 27-38 4-96 3-150 5-18 1-33 0-44-2-3-9-2-19 1-28z'/%3E%3C/svg%3E");
  --brush-wide-2: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 40' preserveAspectRatio='none'%3E%3Cpath d='M3 6c45 3 100-2 150 1 18 1 34-1 44 2 3 10 1 20 2 28-40-2-100 3-150 1-17 0-32 2-45 0-3-10 0-21-1-30z'/%3E%3C/svg%3E");
}
html.tg.tg-dark {
  --soft: var(--tint);
  --rule: var(--line);
}

/* кнопки и поля */
.btn {
  border-radius: 16px;
}
.btn.line,
.btn.done {
  background: var(--soft);
  box-shadow: none;
}
/* поле видно сразу: серая подложка и тонкая рамка — понятно, куда писать */
input,
select,
textarea {
  border-radius: 14px;
  border-color: rgb(11 11 12 / 0.07);
  background-color: var(--soft);
}
html.tg.tg-dark :is(input, select, textarea) {
  border-color: var(--line);
}
:is(input, select, textarea):focus {
  border-color: var(--blue);
  background-color: var(--bg);
}
.av {
  border-radius: 50%;
}
.tag {
  padding: 3px 10px;
}
.kb-done {
  border-radius: 999px;
}

/* плашки вместо линий */
.list > .card,
.ob-preview .card {
  margin-top: 10px;
  padding: 16px;
  border-top: 0;
  border-radius: 20px;
  background: var(--soft);
}
.mytrip {
  padding: 14px 16px;
  border: 0;
  border-radius: 18px;
  background: var(--soft);
}
/* у «Анкеты в поиске» остаётся синяя рамка — её видно сразу */
.search-card {
  border-radius: 22px;
  background: var(--soft);
}
.search-card .ob-preview .card {
  background: var(--bg);
}

/* мазок: всё, что выбирают */
:is(.dest, .chip, .ob-opt, .seg-opt span) {
  position: relative;
  isolation: isolate;
  border-radius: 0;
  border: 0;
  background: none;
  box-shadow: none;
}
:is(.dest, .chip, .ob-opt, .seg-opt span)::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -2;
  background: var(--soft);
  -webkit-mask: var(--brush) center / 100% 100% no-repeat;
  mask: var(--brush) center / 100% 100% no-repeat;
  transition: background 0.15s var(--ease);
}
:is(.dest.sel, .chip.on, .ob-opt.on, .seg-opt input:checked + span)::after {
  background: var(--blue);
}
:is(.dest.sel, .chip.on, .ob-opt.on, .seg-opt input:checked + span) {
  background: none;
  color: var(--on-blue);
}
.dest {
  --brush: var(--brush-tile-1);
}
.dest:nth-child(3n + 2) {
  --brush: var(--brush-tile-2);
}
.dest:nth-child(3n) {
  --brush: var(--brush-tile-3);
}
:is(.chip, .ob-opt, .seg-opt) {
  --brush: var(--brush-wide-1);
}
:is(.chip, .ob-opt, .seg-opt):nth-child(even) {
  --brush: var(--brush-wide-2);
}

/* страны — плашками, название помещается целиком */
.dests {
  gap: 6px;
}
.dest {
  min-height: 72px;
  padding: 12px 8px 12px 10px;
}
.dest b {
  font-size: clamp(13.5px, 3.9vw, 18px);
  letter-spacing: -0.035em;
}
@media (max-width: 340px) {
  .dest b {
    font-size: 12px;
  }
}
.dest.sel b {
  padding: 0;
  background: none;
  color: var(--on-blue);
}
.dest.sel small {
  color: rgb(255 255 255 / 0.75);
}
:is(.dest, .chip, .ob-opt) {
  transition:
    color 0.15s var(--ease),
    transform 0.12s var(--ease);
}
:is(.dest, .chip, .ob-opt):active {
  transform: scale(0.97);
}
.chip {
  padding: 8px 14px;
}

/* метки интересов в карточках: общие с тобой — синим мазком (выделено
   маркером, что совпадает), остальные — светлым мазком на плашке */
.tag {
  --brush: var(--brush-wide-1);
  position: relative;
  isolation: isolate;
  border-radius: 0;
  box-shadow: none;
  background: none;
}
.tag:nth-child(even) {
  --brush: var(--brush-wide-2);
}
.tag::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -2;
  background: var(--bg);
  -webkit-mask: var(--brush) center / 100% 100% no-repeat;
  mask: var(--brush) center / 100% 100% no-repeat;
}
.tag.match {
  background: none;
}
.tag.match::after {
  background: var(--blue);
}

/* скрытая анкета — без синей рамки: выделяем только то, что видят другие */
.search-card.off {
  box-shadow: none;
}

/* экран загрузки: подпись — крупно и жирно, как заголовок «Свои попутчики» */
.splash-t {
  font-family: var(--f);
  font-size: 24px;
  font-weight: 760;
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-transform: none;
  color: var(--ink);
}

/* сердечко от руки синей ручкой — дорисовывается при открытии экрана */
.hand-heart {
  display: inline-block;
  width: 1.25em;
  height: 1.15em;
  margin-left: 0.15em;
  vertical-align: -0.2em;
  color: var(--blue);
  rotate: -8deg;
}
.hand-heart path {
  stroke-dasharray: 110;
  stroke-dashoffset: 110;
  animation: heart-draw 0.9s 0.3s cubic-bezier(0.6, 0, 0.3, 1) forwards;
}
@keyframes heart-draw {
  to {
    stroke-dashoffset: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .hand-heart path {
    animation: none;
    stroke-dashoffset: 0;
  }
}

/* свои интересы: метка с крестиком (нажатие убирает), «+ Своё» и поле */
.chip.own span {
  margin-left: 6px;
  opacity: 0.75;
}
.chip.add {
  color: var(--blue);
}
.custom-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 10px;
}
.custom-add .btn {
  min-height: 48px;
  padding: 0 18px;
}

/* Поля ввода: при фокусе — одна синяя рамка. Обводка фокуса с клавиатуры
   остаётся у кнопок и ссылок, у полей её заменяет рамка */
:is(input, select, textarea):focus-visible {
  outline: none;
}

/* Галочки согласий и причины жалобы — свой кружок вместо системного (тот
   на iPhone брал общие стили полей и рисовал тень). Нажатие без серой
   вспышки: пока палец на строке, кружок сжимается; отметил — кружок
   заливается синим, а галочка дорисовывается линией */
.consent-box,
.report-option {
  -webkit-tap-highlight-color: transparent;
}
.tick-box {
  position: relative;
  width: 24px;
  height: 24px;
}
.consent-box input,
.report-option input {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 24px;
  height: 24px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
  background: var(--bg);
  box-shadow: none;
  transition:
    transform 0.18s var(--ease),
    background-color 0.15s,
    border-color 0.15s,
    box-shadow 0.15s;
}
.consent-box input:checked {
  border-color: var(--blue);
  background: var(--blue);
  animation: tick-pop 0.28s var(--ease);
}
/* переключатель: синее кольцо с белой точкой */
.report-option input:checked {
  border-color: var(--blue);
  background: var(--blue);
  box-shadow:
    inset 0 0 0 6px var(--blue),
    inset 0 0 0 12px var(--on-blue);
  animation: tick-pop 0.28s var(--ease);
}
.consent-box:active input,
.report-option:active input {
  transform: scale(0.84);
}
.consent-box input:focus-visible,
.report-option input:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.tick {
  position: absolute;
  inset: 0;
  width: 24px;
  height: 24px;
  pointer-events: none;
  fill: none;
  stroke: var(--on-blue);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 16;
  stroke-dashoffset: 16;
}
.tick-box input:checked + .tick {
  animation: tick-draw 0.24s 0.06s var(--ease) forwards;
}
@keyframes tick-draw {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes tick-pop {
  0% {
    transform: scale(0.84);
  }
  60% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .consent-box input:checked,
  .report-option input:checked {
    animation: none;
  }
  .tick-box input:checked + .tick {
    animation: none;
    stroke-dashoffset: 0;
  }
}
.consent-box > span:last-child {
  padding-top: 1px;
}

/* Поля на серой плашке (карточка в ленте, превью, «Анкета в поиске») —
   белые с тонкой рамкой, иначе поле сливается с плашкой (подробности
   жалобы). Только там, где плашка серая: форма поездки — тоже .card, но на
   белом фоне, и белые поля в ней пропадали совсем */
:is(.list > .card, .ob-preview .card, .mytrip, .search-card)
  :is(input:not([type='checkbox']):not([type='radio']), select, textarea) {
  background-color: var(--bg);
  border-color: var(--line);
}

/* «сообществе ♡» — не разрываются: сердечко не остаётся одно на строке */
.nobr {
  white-space: nowrap;
}

/* несколько поездок — карточки листаются вбок, у каждой подпись страны */
.ob-previews {
  display: flex;
  gap: 10px;
  /* до синей рамки карточки (1.5px), но не поверх неё */
  margin-inline: -14px;
  padding: 0 14px 4px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 14px;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.ob-previews::-webkit-scrollbar {
  display: none;
}
.ob-previews .ob-preview {
  flex: 0 0 86%;
  scroll-snap-align: start;
}
.ob-cap-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
}
.ob-cap-row .go {
  min-height: 32px;
  font-size: 14px;
}

/* «Мои анкеты»: у каждой поездки — своя плашка: карточка, как её видят
   свои, и действия. Видна поездка — синяя рамка у плашки, скрыта — без
   рамки и бледная. Несколько поездок листаются вбок до края экрана */
.my-trips {
  display: grid;
  gap: 12px;
  margin: 18px 0 6px;
}
.my-trips h2,
.my-trips > p {
  margin: 0;
}
.my-trips h2 .v {
  color: var(--muted);
}
.my-trips h2 .mark {
  display: inline-block;
  margin-left: 0.1em;
}
.my-trip {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px 10px;
  border-radius: 22px;
  background: var(--soft);
}
.my-trip.on {
  box-shadow: inset 0 0 0 2px var(--blue);
}
.my-trip .ob-preview {
  flex: 1;
  display: grid;
}
.my-trip .ob-preview .card {
  background: var(--bg);
}
.my-trip .ob-cap-row .label.on {
  color: var(--blue);
}
.my-trip .trip-about.empty {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.my-trip .acts {
  display: flex;
  gap: 18px;
}
.my-trip .acts .go {
  min-height: 36px;
}
.my-trip .acts.confirm {
  align-items: center;
}
.my-trip .acts.confirm span {
  font-weight: 600;
}
/* несколько поездок — вбок, до края экрана; соседняя выглядывает справа */
.my-trips-row {
  margin-inline: -16px;
  padding: 0 16px 4px;
  scroll-padding-inline: 16px;
  align-items: stretch;
}
.my-trips-row .my-trip {
  flex: 0 0 86%;
  scroll-snap-align: start;
}
.my-trips .hide-all {
  justify-self: center;
  min-height: 36px;
  font-size: 14px;
  color: var(--muted);
}
.my-trips .form.card {
  border-top: 0;
  padding-top: 6px;
}
.past-trips summary {
  cursor: pointer;
  min-height: 36px;
  display: flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

/* заявка: на какую поездку — строка переносится целиком (только текст;
   метка «даты совпадают» остаётся по ширине слова) */
.dl > .dl-text {
  min-width: 0;
  flex: 1;
}

/* Касание без серой вспышки iPhone по всему приложению; ссылки на нажатие
   слегка бледнеют (кнопки и плашки отвечают своей заливкой) */
html {
  -webkit-tap-highlight-color: transparent;
}
a:active {
  opacity: 0.6;
}

/* Всплывающее сообщение — белым по фирменному синему мазку */
.toast {
  isolation: isolate;
  background: none;
  color: var(--on-blue);
  border-radius: 0;
  padding: 14px 22px;
  font-weight: 600;
  filter: drop-shadow(0 6px 14px rgb(0 100 253 / 0.28));
}
.toast::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--blue);
  -webkit-mask: var(--brush-wide-1) center / 100% 100% no-repeat;
  mask: var(--brush-wide-1) center / 100% 100% no-repeat;
}

/* «Заявка отправлена» — синим текстом без подложки, рядом галочка. Только
   что отправил — надпись всплывает, галочка дорисовывается линией */
.btn.done {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: none;
  color: var(--blue);
  box-shadow: none;
}
.btn.done:disabled {
  opacity: 1;
}
.sent-tick {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 22;
}
.btn.done.just span {
  animation: sent-in 0.35s var(--ease) both;
}
.btn.done.just .sent-tick {
  stroke-dashoffset: 22;
  animation: tick-draw 0.3s 0.25s var(--ease) forwards;
}
@keyframes sent-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .btn.done.just span,
  .btn.done.just .sent-tick {
    animation: none;
    stroke-dashoffset: 0;
  }
}

/* пара слов к заявке — прямо в карточке */
.want-form {
  display: grid;
  gap: 10px;
}

/* экран сообщества и ошибки загрузки */
.gate-note {
  color: var(--muted);
  font-size: 15px;
}
.err-code {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

/* карточка в поиске: заявку между нами уже приняли или ждут моего ответа */
.linked {
  display: grid;
  gap: 10px;
}
.linked-note {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* профиль без фото: почему стоит добавить */
.photo-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

/* Выпадающие списки (пол, страна, район) — своя стрелка вместо системной.
   На компьютере (Telegram Desktop, macOS) системный список рисовался
   по-своему: ниже остальных полей и с почти прямыми углами. Подложку
   выше задаёт background-color, поэтому стрелка не пропадает при фокусе
   и на белых полях в карточках */
select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='%238a8a8e' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 5.25 7 9.25l4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 14px 14px;
  text-overflow: ellipsis;
}

/* Обратная связь внизу профиля: Свойсик, пара тёплых слов и кнопка */
.feedback {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px 16px;
  align-items: start;
  padding: 18px;
  border-radius: 20px;
  background: var(--soft);
}
.feedback-pic {
  width: 64px;
  height: auto;
}
.feedback h2 {
  margin: 2px 0 6px;
  font: 700 19px/1.2 var(--f);
  letter-spacing: -0.02em;
  text-transform: none;
}
.feedback p {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--muted);
}
.feedback p + p {
  margin-top: 8px;
}
.feedback > .btn,
.fb-swap,
.feedback-done {
  grid-column: 1 / -1;
}
/* кнопка «Написать нам» и поле меняются местами плавно: одно сворачивается,
   другое разворачивается */
.fb-fold {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition:
    grid-template-rows 0.32s var(--ease),
    opacity 0.2s var(--ease);
}
.fb-fold.open {
  grid-template-rows: 1fr;
  opacity: 1;
  transition:
    grid-template-rows 0.32s var(--ease),
    opacity 0.25s var(--ease) 0.08s;
}
.fb-in {
  min-height: 0;
  overflow: hidden;
  /* место для рамки поля в фокусе — overflow её не обрежет */
  padding: 2px;
  margin: -2px;
}
.feedback-form:focus {
  outline: none;
}
.feedback-form {
  display: grid;
  gap: 10px;
}
.feedback-form textarea {
  background-color: var(--bg);
}
.feedback .feedback-done {
  margin: 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--bg);
  color: var(--ink);
  font-weight: 600;
}
.feedback .btn {
  text-decoration: none;
}
.feedback .btn.line {
  background-color: var(--bg);
}
/* «Отмена» рядом с «Отправить» — без подложки */
.feedback .feedback-form .btn.line {
  background-color: transparent;
}

/* Аватарка с фото — кнопка: нажал, и фото открывается на весь экран */
.av-zoom {
  position: relative;
  padding: 0;
  border: 0;
  cursor: zoom-in;
  -webkit-tap-highlight-color: transparent;
  transition: scale 0.2s var(--ease);
}
.av-zoom img {
  position: absolute;
  inset: 0;
}
.av-zoom:active {
  scale: 0.96;
}
.av-zoom:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

/* Фото на весь экран (js/ui/viewer.js) */
html.pv-on {
  overflow: hidden;
}
.pv {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  background: rgb(0 0 0 / 0.92);
  opacity: 0;
  transition: opacity 0.2s var(--ease);
  cursor: zoom-out;
}
.pv.in {
  opacity: 1;
}
.pv-img {
  width: min(100%, 560px);
  height: auto;
  max-height: 100%;
  border-radius: 16px;
  object-fit: contain;
  scale: 0.94;
  transition: scale 0.25s var(--ease);
}
.pv.in .pv-img {
  scale: 1;
}
.pv-close {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: 12px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.16);
  color: #fff;
  font: 400 30px/1 var(--f);
  display: grid;
  place-items: center;
}
@media (prefers-reduced-motion: reduce) {
  .pv,
  .pv-img,
  .av-zoom,
  .fb-fold,
  .fb-fold.open,
  #view {
    transition: none;
  }
}
