/* ============================================================================
   СВАДЕБНЫЙ ФОТОСАЙТ · оформление
   Строгий чёрно-белый минимализм. Белый фон, чёрный текст, тонкие серые линии.
   Вёрстка под телефон: колонка шириной до 420 точек по центру экрана.
   ============================================================================ */

:root {
  --ink: #000;
  --paper: #fff;
  --line: #d8d8d8;
  --line-strong: #000;
  --muted: #777;
  --radius: 4px;
  --pad: 20px;

  /* Единственный цвет на всём сайте — закрашенное сердце и его же анимация
     по двойному тапу. Больше нигде цвет не появляется: комментарии, жалобы,
     счётчики и кнопки остаются чёрно-белыми. */
  --like: #ED4956;
}

* { box-sizing: border-box; }

/* атрибут hidden должен побеждать любые display из разметки ниже */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;

  /* Страница не приближается ни двойным тапом, ни щипком — разрешена только
     прокрутка. Свойство не наследуется, но браузер берёт пересечение со всеми
     предками, поэтому одной строки здесь хватает на весь сайт и на панель.
     Внутри правило только сужается: .card-shot оставляет pan-y,
     .crop-stage — none, потому что там жесты пишутся руками. */
  touch-action: pan-x pan-y;
}

body {
  /* 100vh на айфоне считается по экрану без адресной строки Safari и не
     меняется, когда та прячется, — снизу остаётся полоса. 100dvh
     пересчитывается вместе с ней. Первая строка — запасная для браузеров,
     которые про dvh ещё не знают. */
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
}

/* Фон доходит до самых краёв экрана — и под чёлку, и под полосу жеста.
   Содержимое под них не залезает: отступы ниже. */
#app {
  width: 100%;
  max-width: 420px;
  padding: calc(24px + env(safe-area-inset-top, 0px)) var(--pad)
           calc(40px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
}

/* На телефоне колонку не сужаем: у айфонов 14 Pro Max и 15 Plus ширина
   430 точек, и потолок в 420 оставлял по бокам ленты белые полоски по пять
   точек. На большом экране колонка по-прежнему ограничена — там она нужна. */
@media (max-width: 460px) {
  #app { max-width: none; }
}

.screen { display: none; flex-direction: column; flex: 1; }
.screen.is-on { display: flex; }

/* --- Общие мелочи ------------------------------------------------------- */

h1, h2 { font-weight: 500; margin: 0; }

.note {
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
  margin: 12px 0 0;
}

.err {
  display: none;
  font-size: 13px;
  line-height: 1.4;
  margin-top: 6px;
  color: var(--ink);
}
.err.is-on { display: block; }

.spacer { flex: 1; min-height: 24px; }

/* --- Кнопки -------------------------------------------------------------- */

.btn {
  display: block;
  width: 100%;
  padding: 15px 16px;
  font: inherit;
  font-size: 16px;
  text-align: center;
  border-radius: var(--radius);
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.btn + .btn { margin-top: 10px; }

.btn-solid { background: var(--ink); color: var(--paper); }
.btn-ghost { background: var(--paper); color: var(--ink); }

.btn-dashed {
  border-style: dashed;
  border-color: var(--muted);
  color: var(--ink);
}

.btn[disabled] {
  opacity: .35;
  cursor: default;
}

.btn-row { display: flex; gap: 10px; }
.btn-row .btn { margin-top: 0; }

.link {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  align-self: flex-start;
  -webkit-tap-highlight-color: transparent;
}

/* --- Шапки экранов ------------------------------------------------------- */

.head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 22px;
}
.head h2 { font-size: 20px; }

/* --- Экран 1. Старт ------------------------------------------------------ */

.brand { text-align: center; padding: 48px 0 40px; }

.brand-word {
  margin: 0;
  font-size: 14px;
  letter-spacing: .42em;
  text-indent: .42em;
  text-transform: uppercase;
  color: var(--ink);
}

.brand-names {
  margin: 18px 0 0;
  font-size: 30px;
  font-weight: 400;
  letter-spacing: .01em;
  line-height: 1.2;
}

.brand-date {
  margin: 14px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.brand-rule {
  width: 40px;
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 26px auto 0;
}

.start-actions { margin-top: 8px; }
.start-note { text-align: center; }

/* --- Поля ---------------------------------------------------------------- */

.field { display: block; margin-bottom: 22px; }

.label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 7px;
}

.input {
  display: block;
  width: 100%;
  padding: 12px 0;
  font: inherit;
  font-size: 17px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}
.input:focus { outline: none; border-bottom-color: var(--line-strong); }
.input::placeholder { color: #bbb; }

/* --- Пин-код ------------------------------------------------------------- */

.pin { display: flex; gap: 10px; }

.pin-cell {
  width: 100%;
  height: 56px;
  padding: 0;
  font: inherit;
  font-size: 22px;
  text-align: center;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  -webkit-appearance: none;
  appearance: none;
}
.pin-cell:focus { outline: none; border-color: var(--line-strong); }

/* --- Экран 3. Аватар ----------------------------------------------------- */

.avatars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}

.ava {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  cursor: pointer;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.ava img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ava.is-picked { border-width: 3px; border-color: var(--ink); }

.own-wrap { display: flex; justify-content: center; margin-bottom: 18px; }
.own-wrap .ava { width: 104px; }

/* --- Экран подгонки фото ------------------------------------------------- */

.crop-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.crop-stage canvas { display: block; width: 100%; height: 100%; }

.crop-hole {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  box-shadow: 0 0 0 2000px rgba(0, 0, 0, .58);
  border: 1px solid rgba(255, 255, 255, .85);
  pointer-events: none;
}

/* --- Экран «Вход закрыт» ------------------------------------------------- */

.blocked { text-align: center; padding: 80px 0 40px; }
.blocked h2 { font-size: 22px; }

/* ==========================================================================
   ЛЕНТА
   Лента и карточка гостя идут во всю ширину колонки: фото упирается в края,
   поэтому отступы #app здесь гасятся отрицательным полем.
   ========================================================================== */

/* Отступы #app здесь гасятся ровно теми же числами, которыми поставлены,
   вместе с безопасными зонами: иначе над шапкой ленты повисла бы белая
   полоса высотой с чёлку. Снизу зона возвращается своим отступом — последняя
   карточка не должна уходить под полосу жеста, а фон под ней всё равно белый. */
.screen-wide {
  margin: calc(-24px - env(safe-area-inset-top, 0px)) -20px
          calc(-40px - env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Шапка не уезжает при прокрутке. Плашки живут в том же липком блоке,
   иначе они уползают под шапку и их не видно. */
.sticky {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
}

.topbar {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 8px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px;
  border-bottom: 1px solid var(--line);
}

.topbar-title {
  margin: 0;
  text-align: center;
  font-size: 11px;
  letter-spacing: .16em;
  text-indent: .16em;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.topbar-btn svg { width: 24px; height: 24px; display: block; }
.topbar-btn.is-off { color: #c4c4c4; }
.topbar-hole { cursor: default; }

.topbar-me {
  justify-self: end;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  overflow: hidden;
  background: var(--paper);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.topbar-me img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Плашка «N новых фото» */
.newbar {
  display: block;
  width: 100%;
  padding: 9px 12px;
  font: inherit;
  font-size: 13px;
  text-align: center;
  color: var(--paper);
  background: var(--ink);
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* Плашка «Загрузка закрыта» */
.ribbon {
  margin: 0;
  padding: 9px 16px;
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
  color: var(--muted);
  background: #f4f4f4;
  border-bottom: 1px solid var(--line);
}

.feed-count {
  margin: 0;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

/* --- Карточка фотографии ------------------------------------------------- */

.feed { display: block; }

.card { border-bottom: 1px solid var(--line); }

.card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}

.card-who {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.card-ava {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  overflow: hidden;
  background: #f0f0f0;
}
.card-ava img { display: block; width: 100%; height: 100%; object-fit: cover; }

.card-nick {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-time {
  margin-left: auto;
  flex: 0 0 auto;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Пропорции снимка известны заранее — место под него держится с самого начала,
   поэтому лента не прыгает, пока фото грузится. */
/* pan-y разрешает вертикальную прокрутку и заодно снимает с этого места
   двойной тап браузера — иначе второе касание зумило бы страницу вместо лайка.
   Выделение текста тоже гасим: длинное касание по фото ничего не выделяет. */
.card-shot {
  position: relative;
  width: 100%;
  background: #ececec;
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.card-shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity .18s linear;
}
.card-shot.is-ready img { opacity: 1; }
.card-shot.is-ready { background: var(--paper); }

/* --- Большое сердце по двойному тапу ------------------------------------- */

/* Лежит в карточке всегда и всегда невидимо: появись оно только на время
   показа — карточка бы дёрнулась. Двигаются лишь transform и opacity,
   размеры не меняются, поэтому на слабых телефонах не дёргается. */
.pop {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 96px;
  height: 96px;
  margin: 0;
  color: var(--like);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.2);
  will-change: transform, opacity;
}
.pop svg { width: 100%; height: 100%; display: block; }
.pop svg path { fill: currentColor; stroke: none; }

.pop.is-pop { animation: popHeart 800ms ease-out forwards; }

@keyframes popHeart {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.2); }
  14%  { opacity: 1; transform: translate(-50%, -50%) scale(1.18); }  /* лёгкий перелёт */
  28%  { opacity: 1; transform: translate(-50%, -50%) scale(0.92); }
  40%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  72%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.14); }
}

/* --- Строка действий под снимком ----------------------------------------- */

.acts {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;               /* на 375 точках всё обязано уместиться в строку */
  gap: 14px;
  padding: 4px 10px;
}

.act {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;                /* палец должен попадать без прицеливания */
  min-width: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  font: inherit;
  font-size: 17px;
  color: var(--ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.act svg { width: 33px; height: 33px; display: block; }
.act-n { font-variant-numeric: tabular-nums; min-width: 9px; }

/* Закрашенное сердце — единственное цветное пятно на сайте */
.act-like.is-on { color: var(--like); }
.act-like.is-on svg path { fill: currentColor; }
.act-like .act-n { color: var(--ink); }

/* Короткий подскок при постановке лайка. Тоже только transform. */
.act-like.is-bump svg { animation: bumpHeart 320ms ease-out; }

@keyframes bumpHeart {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.28); }
  65%  { transform: scale(0.94); }
  100% { transform: scale(1); }
}

/* Жалоба — обычная текстовая кнопка справа, серым */
.act-report {
  margin-left: auto;
  min-height: 44px;
  padding: 0 2px;
  border: 0;
  background: none;
  font: inherit;
  font-size: 15px;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* --- Последние комментарии прямо в ленте --------------------------------- */

.talk { padding: 0 12px 10px; }

.talk-line {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.4;
  word-break: break-word;
}
.talk-line b { font-weight: 600; }

.talk-all {
  display: block;
  margin: 4px 0 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 13px;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ==========================================================================
   ШТОРКА КОММЕНТАРИЕВ
   Отдельного экрана комментариев нет: они выезжают снизу поверх ленты.
   Двигается шторка только transform: translateY — ни top, ни height,
   ни margin, иначе на слабых андроидах перетаскивание будет дёргаться.
   ========================================================================== */

/* Привязана к динамической высоте, а не к inset: 0. У закреплённого блока
   inset считается по экрану без адресной строки Safari — когда та появляется,
   низ шторки вместе с полем ввода уезжает за край. */
.sheet-wrap {
  position: fixed;
  inset: 0;
  top: 0;
  left: 0;
  right: 0;
  bottom: auto;
  height: 100dvh;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet-back {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .38);
  opacity: 0;
  transition: opacity 280ms ease;
}
.sheet-wrap.is-open .sheet-back { opacity: 1; }
.sheet-wrap.is-dragging .sheet-back { transition: none; }

.sheet {
  position: relative;
  width: 100%;
  max-width: 420px;
  height: 85%;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
  overflow: hidden;
  transform: translateY(100%);
  transition: transform 280ms cubic-bezier(.22, .61, .36, 1);
  will-change: transform;
}
.sheet-wrap.is-open .sheet { transform: translateY(0); }

/* На время перетаскивания плавность снимается полностью: шторка обязана
   идти за пальцем один в один, без задержки и без инерции. */
.sheet-wrap.is-dragging .sheet { transition: none; }

/* Ручка и шапка тянут шторку всегда, поэтому прокрутку здесь отключаем.
   Выделение тоже: иначе медленное движение с зажатой кнопкой мыши браузер
   принимает за выделение текста и перетаскивание. */
.sheet-grab,
.sheet-head {
  user-select: none;
  -webkit-user-select: none;
}

.sheet-grab {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  padding: 10px 0 6px;
  touch-action: none;
  cursor: grab;
}
.sheet-bar {
  display: block;
  width: 38px;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
}

.sheet-head {
  flex: 0 0 auto;
  padding: 2px 16px 10px;
  border-bottom: 1px solid var(--line);
  touch-action: none;
}
.sheet-title {
  margin: 0;
  text-align: center;
  font-size: 13px;
  letter-spacing: .1em;
  text-indent: .1em;
  text-transform: uppercase;
  color: var(--ink);
}

/* Список прокручивается сам; шторку он отдаёт только когда прокручен
   в самый верх — этим занимается app.js. overscroll-behavior не даёт
   прокрутке протечь на ленту под шторкой. */
.sheet-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* --- Комментарий --------------------------------------------------------- */

.cm-list { padding: 4px 0 0; }

.cm {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

/* Заглушка или своя картинка — так же, как в карточке фото. Пустого места
   тут быть не должно, поэтому у кружка всегда есть серая подложка. */
.cm-face {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  margin-top: 1px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  overflow: hidden;
  background: #f0f0f0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.cm-face img { display: block; width: 100%; height: 100%; object-fit: cover; }

.cm-main { flex: 1 1 auto; min-width: 0; }

.cm-body {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  word-break: break-word;
}

.cm-nick {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.cm-foot {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 5px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.cm-del {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 12px;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.cm-none { margin: 0; padding: 28px 16px; font-size: 14px; color: var(--muted); }

/* --- Поле ввода комментария ---------------------------------------------- */

/* Прижато к низу шторки. Над клавиатурой его поднимает app.js: он следит
   за видимой частью экрана и подставляет отступ снизу. */
.say {
  flex: 0 0 auto;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.say-row { display: flex; align-items: baseline; gap: 12px; }

.say-input {
  flex: 1;
  min-width: 0;
  padding: 10px 0;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}
.say-input:focus { outline: none; border-bottom-color: var(--line-strong); }
.say-input::placeholder { color: #bbb; }

.say-go {
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.say-go[disabled] { color: var(--muted); cursor: default; }

.say-left { margin-top: 6px; }

/* Пока шторка открыта, лента под ней стоит на месте и не оттягивается
   вниз на айфоне. Смещение сохраняется в app.js и возвращается при закрытии. */
body.is-locked {
  position: fixed;
  width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

/* --- Окно подтверждения --------------------------------------------------- */

.ask-wrap {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.ask-back {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .38);
}

.ask {
  position: relative;
  width: 100%;
  max-width: 340px;
  padding: 22px 20px 18px;
  background: var(--paper);
  border-radius: 8px;
}

.ask-text {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.45;
}

.ask-row { display: flex; gap: 10px; }
.ask-row .btn { margin-top: 0; }

/* --- Выход из аккаунта ---------------------------------------------------- */

/* Контурная и внизу: на своей карточке это не главное действие */
.guest-exit { padding: 28px 16px calc(8px + env(safe-area-inset-bottom, 0px)); }

/* Серые прямоугольники на месте ещё не пришедших карточек */
.card.is-skeleton .card-shot { aspect-ratio: 4 / 5; }
.skel {
  background: #ececec;
  border-radius: 3px;
}
.card.is-skeleton .card-ava { background: #ececec; border-color: #ececec; }
.card.is-skeleton .skel-nick { width: 92px; height: 12px; }
.card.is-skeleton .skel-time { width: 34px; height: 12px; margin-left: auto; }

/* --- Пустая лента -------------------------------------------------------- */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 80px 24px 40px;
  color: var(--ink);
}
.empty-icon { width: 48px; height: 48px; color: var(--muted); }
.empty-title { margin: 18px 0 0; font-size: 18px; }
.empty-sub { margin: 8px 0 0; font-size: 13px; color: var(--muted); }

/* --- Экран загрузки ------------------------------------------------------ */

.up-body { padding: 20px 16px calc(8px + env(safe-area-inset-bottom, 0px)); }

.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 200px;
  padding: 28px 20px;
  font: inherit;
  color: var(--ink);
  text-align: center;
  background: var(--paper);
  border: 1px dashed var(--muted);
  border-radius: var(--radius);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.drop[disabled] { opacity: .35; cursor: default; }

.drop-icon { width: 44px; height: 44px; margin-bottom: 6px; color: var(--muted); }
.drop-title { font-size: 16px; }
.drop-sub { font-size: 13px; color: var(--muted); }

.up-run { margin-top: 24px; }

.up-line { margin: 0; font-size: 14px; }

.up-bar {
  height: 2px;
  margin-top: 10px;
  background: var(--line);
  overflow: hidden;
}
.up-bar-fill {
  display: block;
  width: 0;
  height: 100%;
  background: var(--ink);
  transition: width .2s linear;
}

.up-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.up-thumb {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #ececec;
}
.up-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .3;
  transition: opacity .18s linear;
}
.up-thumb.is-done img { opacity: 1; }
.up-thumb.is-bad { border-color: var(--ink); }
.up-thumb.is-bad img { opacity: .1; }

.up-warn { margin-top: 16px; }

.up-done { margin-top: 24px; }
.up-result { margin: 0 0 14px; font-size: 14px; line-height: 1.4; }

/* --- Карточка гостя ------------------------------------------------------ */

.guest-head { text-align: center; padding: 28px 20px 0; }

.guest-ava {
  display: inline-block;
  width: 88px;
  height: 88px;
  border: 1px solid var(--line);
  border-radius: 50%;
  overflow: hidden;
  background: #f0f0f0;
}
.guest-ava img { display: block; width: 100%; height: 100%; object-fit: cover; }

.guest-nick { margin: 14px 0 0; font-size: 20px; font-weight: 500; }

.nums {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 24px 0 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.num { text-align: center; padding: 16px 8px; }
.num + .num { border-left: 1px solid var(--line); }
.num b { display: block; font-size: 22px; font-weight: 500; font-variant-numeric: tabular-nums; }
.num span { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); }

.grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 2px 0 0;
}

.cell { position: relative; }

.cell-shot {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 0;
  background: #ececec;
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.cell-shot img { display: block; width: 100%; height: 100%; object-fit: cover; }

.cell-del {
  display: block;
  width: 100%;
  padding: 6px 2px 8px;
  font: inherit;
  font-size: 12px;
  text-align: center;
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.guest-none { text-align: center; padding: 40px 20px; font-size: 14px; color: var(--muted); }

/* --- Сайт закрыт --------------------------------------------------------- */

.thanks {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 8px;
}
.thanks-word { margin: 0; font-size: 20px; line-height: 1.45; }

/* --- Всплывающее сообщение ----------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 50;
  max-width: 320px;
  padding: 11px 16px;
  font-size: 14px;
  line-height: 1.35;
  text-align: center;
  color: var(--paper);
  background: var(--ink);
  border-radius: var(--radius);
}
