/* Кабинет доставки: вход по QR на ПК (e1) и профиль компании (e2). */

/* e1 Сканирование QR: тёмный экран, камера занимает всю середину. */
.screen--scan { padding-top: 0; background: var(--cab-ink); color: #fff; }
.scan__viewfinder { position: relative; overflow: hidden; }
.scan__title {
  position: absolute;
  left: 20px;
  right: 20px;
  top: max(16px, env(safe-area-inset-top));
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1;
}
.scan__stack { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 44px; }

/* Видоискатель: только уголки рамки поверх затемнённого фона. */
.scan__frame { position: relative; display: block; width: 250px; height: 250px; }
.scan__corner { position: absolute; width: 34px; height: 34px; }
.scan__corner--tl { left: 0; top: 0; border-top: 3px solid var(--cab-accent); border-left: 3px solid var(--cab-accent); }
.scan__corner--tr { right: 0; top: 0; border-top: 3px solid var(--cab-accent); border-right: 3px solid var(--cab-accent); }
.scan__corner--bl { left: 0; bottom: 0; border-bottom: 3px solid var(--cab-accent); border-left: 3px solid var(--cab-accent); }
.scan__corner--br { right: 0; bottom: 0; border-bottom: 3px solid var(--cab-accent); border-right: 3px solid var(--cab-accent); }

.scan__allow { min-height: 52px; font-size: 15.5px; }
.scan__allow:hover { background: var(--cab-accent-deep); }

/* Кнопка и ошибка: обёртка ровно по кнопке, ошибка висит под ней абсолютно и рамку не двигает. */
.scan__action { position: relative; display: flex; }
.scan__error { position: absolute; top: calc(100% + 12px); left: 50%; width: max-content; max-width: 300px; margin: 0; transform: translateX(-50%); font-size: 14px; line-height: 1.4; text-align: center; }

.scan__hint {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
}
.scan__url { padding: 3px 10px; border-radius: 999px; background: #fff; color: var(--cab-ink); font-weight: 700; }

/* Живая камера: движок кладёт <video> в .scan__camera; видео на весь видоискатель, без зеркалирования. */
.scan__camera { position: absolute; inset: 0; }
.scan__camera video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Камера включена: кнопка прячется без сдвига рамки, вокруг окна рамки — затемнение. */
.screen--scan.is-camera-on .scan__action { visibility: hidden; }
.screen--scan.is-camera-on .scan__frame { box-shadow: 0 0 0 999px color-mix(in srgb, var(--cab-ink) 42%, transparent); }

/* Заголовок и подсказка над тенью рамки: заголовок в DOM раньше .scan__stack, без z-index тень легла бы на него. */
.screen--scan.is-camera-on .scan__title,
.screen--scan.is-camera-on .scan__hint { z-index: 1; }

/* Скрим сверху и снизу под белые заголовок и подсказку; на ::after, потому что детей .scan__camera меняет движок. */
.screen--scan.is-camera-on .scan__camera::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    color-mix(in srgb, var(--cab-ink) 50%, transparent),
    transparent 120px calc(100% - 120px),
    color-mix(in srgb, var(--cab-ink) 50%, transparent)
  );
}

/* e2 Профиль: карточки не скроллятся, кнопка сохранения прижата к низу. */
.profile__body { display: flex; flex-direction: column; gap: 12px; overflow: hidden; margin: 16px 16px 0; }
.profile__card { display: flex; flex-direction: column; padding: 18px; border-radius: 20px; }
.profile__card--logo { gap: 10px; }
.profile__card--name { gap: 9px; }

.profile__logo { display: flex; align-items: center; gap: 16px; }
.profile__preview { position: relative; display: block; width: 110px; height: 110px; flex: none; overflow: hidden; border-radius: 18px; background: var(--cab-surface-2); }
.profile__preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.profile__tools { display: grid; min-width: 0; flex: 1; gap: 8px; grid-template-columns: 1fr 1fr; }
.profile__tool { display: grid; min-height: 50px; place-items: center; border: 1px solid var(--cab-line-3); border-radius: 14px; background: var(--cab-surface); color: #46544a; }
.profile__tool--danger { border-color: #efe0e0; color: #b4443c; }

.profile__input { min-height: 52px; padding: 0 16px; font-size: 16px; }
.profile__save { margin-top: auto; min-height: 54px; font-size: 15.5px; }
.screen--profile app-tab-bar { margin-top: 14px; }
