/* Активный житель города Соликамска — v2, mobile-first */
:root {
  --blue: #0d4cd3;
  --blue-2: #2f6bff;
  --blue-dark: #0a3cab;
  --blue-deep: #071f56;
  --blue-bg: #e9f0ff;
  --ink: #0e1626;
  --muted: #67718a;
  --line: #e5eaf4;
  --bg: #f3f5fa;
  --ok: #0da25c;
  --ok-bg: #e4f7ec;
  --warn: #c97a06;
  --warn-bg: #fff4e2;
  --red: #e5484d;
  --red-bg: #ffedee;
  --shadow: 0 1px 2px rgba(14, 30, 80, .05), 0 8px 24px rgba(14, 30, 80, .06);
  --radius: 18px;
  --nav-h: 64px;
}
* { margin: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Golos Text', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg); color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  /* Приложение не масштабируется: manipulation убирает зум по двойному тапу
     (щипок дополнительно гасится в pwa.js — meta user-scalable iOS игнорирует). */
  touch-action: manipulation;
}
.container { max-width: 960px; margin: 0 auto; padding: 0 16px; }
a { color: var(--blue); }
a:hover { color: var(--blue-dark); }
img { max-width: 100%; }
h1, h2, h3 { text-wrap: balance; }

/* ── Кнопки ── */
.btn {
  display: inline-flex; align-items: center; gap: 10px; justify-content: center;
  border: none; border-radius: 14px; cursor: pointer; text-decoration: none;
  font-weight: 600; font-size: 15px; padding: 13px 20px; transition: .18s;
  font-family: inherit; min-height: 44px;
}
.btn:active { transform: scale(.97); }
.btn-esia { background: var(--blue); color: #fff; box-shadow: 0 6px 16px rgba(13, 76, 211, .28); }
.btn-esia:hover { background: var(--blue-dark); }
.btn-lg { font-size: 16.5px; padding: 16px 28px; border-radius: 16px; width: 100%; }
.btn-sm { font-size: 13.5px; padding: 9px 14px; min-height: 38px; border-radius: 11px; }
/* ── Кнопка входа через MAX ──
   Градиент подхватывает фирменную радугу логотипа, сам логотип лежит в белом
   круге — на нём он читается так же, как в самом мессенджере. */
.btn-login-max {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 14px;
  width: 100%; max-width: 380px; padding: 12px 16px;
  border-radius: 18px; text-decoration: none; cursor: pointer;
  background: linear-gradient(125deg, #5b5bf5 0%, #8b46f0 42%, #d946a8 78%, #f4763f 100%);
  box-shadow: 0 10px 28px rgba(91, 91, 245, .45), inset 0 1px 0 rgba(255,255,255,.25);
  transition: transform .18s, box-shadow .18s;
}
.btn-login-max:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(139, 70, 240, .55), inset 0 1px 0 rgba(255,255,255,.3); }
.btn-login-max:active { transform: translateY(0) scale(.985); }
.blm-ic {
  width: 44px; height: 44px; flex: none; border-radius: 14px; background: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px rgba(20, 8, 60, .22);
}
.blm-ic img { display: block; }
.blm-tx { flex: 1; color: #fff; font-size: 16.5px; font-weight: 500; letter-spacing: -.01em; text-align: left; }
.blm-tx b { font-weight: 800; }
.blm-arr { color: rgba(255, 255, 255, .75); flex: none; transition: transform .18s; }
.btn-login-max:hover .blm-arr { transform: translateX(3px); }
/* Блик, пробегающий по кнопке при наведении. */
.btn-login-max::after {
  content: ''; position: absolute; inset: 0 auto 0 -60%; width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.28), transparent);
  transform: skewX(-18deg); transition: left .55s ease;
}
.btn-login-max:hover::after { left: 115%; }
@media (prefers-reduced-motion: reduce) {
  .btn-login-max, .btn-login-max::after, .blm-arr { transition: none; }
  .btn-login-max:hover { transform: none; }
}
.btn-ok { background: var(--ok); color: #fff; }
.btn-ok:hover { filter: brightness(1.07); }
.btn-danger { background: var(--red-bg); color: var(--red); }
.btn-danger:hover { background: #ffdfe1; }
.btn-ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--line); box-shadow: none; }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ── Лендинг ── */
.landing { background: #fff; }
.land-header { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.82); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.land-header-in { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 10px; }
.brand { display: flex; align-items: center; gap: 9px; font-size: 16.5px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.brand .logo { width: 34px; height: 34px; border-radius: 8px; object-fit: contain; background: #fff; flex: none; }
.hero {
  position: relative; overflow: hidden; color: #fff; text-align: center;
  background: linear-gradient(170deg, #0b3fbf 0%, #08287f 60%, var(--blue-deep) 100%);
  padding: 64px 0 96px;
}
.hero::before, .hero::after {
  content: ''; position: absolute; border-radius: 50%; pointer-events: none;
}
.hero::before { width: 480px; height: 480px; left: -160px; top: -200px; background: radial-gradient(circle, rgba(88, 140, 255, .35), transparent 65%); }
.hero::after { width: 560px; height: 560px; right: -200px; bottom: -260px; background: radial-gradient(circle, rgba(47, 107, 255, .3), transparent 65%); }
.hero .container { position: relative; z-index: 1; }
.hero-crest { margin-bottom: 18px; }
.hero-crest img {
  width: 96px; height: 96px; object-fit: contain; border-radius: 16px;
  background: #fff; padding: 6px; box-shadow: 0 10px 30px rgba(0, 10, 50, .35);
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px; padding: 7px 14px; margin-bottom: 22px; color: #cfe0ff;
}
.hero h1 { font-size: clamp(30px, 6.4vw, 52px); line-height: 1.1; letter-spacing: -.025em; font-weight: 800; margin-bottom: 18px; }
.hero-sub { max-width: 620px; margin: 0 auto 32px; font-size: 16px; line-height: 1.6; color: #bcd0f8; }
.hero-cta { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.hero .btn-esia { background: #fff; color: var(--blue); box-shadow: 0 10px 30px rgba(0, 10, 50, .35); max-width: 380px; }
.hero .btn-esia:hover { background: #e8efff; }
.hero-note { font-size: 12.5px; color: #8ba7e6; }
.steps { display: grid; gap: 14px; margin: -56px auto 44px; position: relative; z-index: 2; }
.step-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 20px; }
.step-num {
  width: 40px; height: 40px; border-radius: 13px; display: flex; align-items: center; justify-content: center;
  background: var(--blue-bg); color: var(--blue); font-weight: 800; font-size: 17px; margin-bottom: 14px;
}
.step-card h3 { font-size: 16.5px; margin-bottom: 7px; letter-spacing: -.01em; }
.step-card p { font-size: 14px; color: var(--muted); line-height: 1.55; }
.cats-strip { margin-bottom: 64px; }
.cats-strip h2 { font-size: 21px; letter-spacing: -.02em; margin-bottom: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip { background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px; font-size: 14px; font-weight: 500; }
.land-footer { border-top: 1px solid var(--line); padding: 24px 0 calc(24px + env(safe-area-inset-bottom)); color: var(--muted); font-size: 12.5px; }
@media (min-width: 700px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
  .hero { padding: 88px 0 120px; }
}

/* ── Каркас приложения ── */
body.app { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
.app-header { position: sticky; top: 0; z-index: 30; background: rgba(243, 245, 250, .85); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.app-header-in { display: flex; align-items: center; justify-content: space-between; height: 58px; gap: 12px; }
.user-chip { display: flex; align-items: center; gap: 9px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px 5px 6px; cursor: pointer; box-shadow: 0 1px 3px rgba(14,30,80,.06); }
.user-chip .ava { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(140deg, var(--blue-2), var(--blue-dark)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; object-fit: cover; }
.user-chip .upts { font-weight: 700; font-size: 13.5px; white-space: nowrap; }
.user-chip .uname { display: none; }

/* Верхние вкладки — только десктоп */
.tabs { display: none; }
main.container { padding: 20px 16px 40px; }
.page-h { font-size: 24px; font-weight: 800; letter-spacing: -.025em; margin: 2px 0 16px; }

/* Нижняя навигация */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: rgba(255,255,255,.92); backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav-in { display: grid; grid-template-columns: repeat(5, 1fr); max-width: 520px; margin: 0 auto; height: var(--nav-h); align-items: center; }
.bn-item {
  border: none; background: none; font-family: inherit; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--muted); font-size: 10.5px; font-weight: 600; padding: 6px 2px;
  position: relative; min-height: 44px; justify-content: center;
}
.bn-item svg { width: 23px; height: 23px; }
.bn-item.active { color: var(--blue); }
.bn-item .cnt {
  position: absolute; top: 2px; left: calc(50% + 4px);
  background: var(--red); color: #fff; border-radius: 999px; font-size: 10px;
  font-weight: 700; padding: 1px 5.5px; border: 2px solid #fff;
}
.bn-fab {
  border: none; cursor: pointer; width: 52px; height: 52px; border-radius: 18px;
  background: linear-gradient(140deg, var(--blue-2), var(--blue-dark)); color: #fff;
  display: flex; align-items: center; justify-content: center; margin: 0 auto;
  box-shadow: 0 8px 20px rgba(13, 76, 211, .4); transform: translateY(-10px); transition: .15s;
}
.bn-fab:active { transform: translateY(-10px) scale(.94); }
.bn-fab svg { width: 26px; height: 26px; }

/* Лист «Ещё» */
.sheet-back { position: fixed; inset: 0; background: rgba(10, 18, 40, .45); z-index: 50; opacity: 0; transition: .2s; }
.sheet-back.show { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; background: #fff;
  border-radius: 22px 22px 0 0; padding: 10px 16px calc(20px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: .25s cubic-bezier(.3, .9, .3, 1);
  max-width: 520px; margin: 0 auto;
}
.sheet.show { transform: none; }
.sheet::before { content: ''; display: block; width: 40px; height: 4px; border-radius: 99px; background: var(--line); margin: 4px auto 12px; }
.sheet-item {
  display: flex; align-items: center; gap: 14px; width: 100%; border: none; background: none;
  font-family: inherit; font-size: 15.5px; font-weight: 600; color: var(--ink);
  padding: 14px 8px; border-radius: 12px; cursor: pointer; text-align: left;
}
.sheet-item:active { background: var(--bg); }
.sheet-item svg { width: 22px; height: 22px; color: var(--muted); }

@media (min-width: 760px) {
  body.app { padding-bottom: 0; }
  .bottom-nav { display: none; }
  .user-chip .uname { display: block; font-weight: 600; font-size: 13.5px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabs { display: block; background: transparent; }
  .tabs-in { display: flex; gap: 6px; max-width: 960px; margin: 0 auto; padding: 14px 16px 0; overflow-x: auto; }
  .tab {
    border: none; cursor: pointer; font-family: inherit; white-space: nowrap;
    padding: 10px 16px; font-size: 14px; font-weight: 600; color: var(--muted);
    background: #fff; border: 1px solid var(--line); border-radius: 999px; transition: .15s;
  }
  .tab:hover { color: var(--blue); border-color: var(--blue); }
  .tab.active { color: #fff; background: var(--blue); border-color: var(--blue); }
  .tab .cnt { background: rgba(255,255,255,.25); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; margin-left: 6px; }
  .tab:not(.active) .cnt { background: var(--red); color: #fff; }
}

/* ── Карточки ── */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }
.card h2 { font-size: 18px; letter-spacing: -.015em; margin-bottom: 14px; }
.empty { text-align: center; color: var(--muted); padding: 44px 12px; font-size: 15px; line-height: 1.6; }
.empty .big { font-size: 40px; display: block; margin-bottom: 10px; }

/* ── Формы ── */
label.f { display: block; font-size: 13px; font-weight: 700; margin: 18px 0 8px; color: #3c455c; }
input[type=text], input[type=number], textarea, select {
  width: 100%; border: 1.5px solid var(--line); border-radius: 13px; padding: 13px 14px;
  font-size: 16px; font-family: inherit; background: #fff; color: var(--ink); transition: .15s;
}
textarea { min-height: 100px; resize: vertical; line-height: 1.5; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-bg); }
.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.cat-opt {
  border: 1.5px solid var(--line); border-radius: 15px; padding: 13px 12px; cursor: pointer;
  background: #fff; text-align: left; font-family: inherit; transition: .15s;
}
.cat-opt:active { transform: scale(.97); }
.cat-opt.sel { border-color: var(--blue); background: var(--blue-bg); box-shadow: 0 0 0 3px var(--blue-bg); }
.cat-opt .ce { font-size: 24px; }
.cat-opt .ct { display: block; font-size: 13.5px; font-weight: 700; margin: 7px 0 3px; line-height: 1.25; }
.cat-opt .cp { font-size: 12px; color: var(--blue); font-weight: 700; }
@media (min-width: 560px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
.photo-drop {
  border: 1.5px dashed #c6d2ea; border-radius: 15px; padding: 24px 16px; text-align: center;
  cursor: pointer; color: var(--muted); font-size: 14px; transition: .15s; background: #fafbfe; line-height: 1.6;
}
.photo-drop:hover { border-color: var(--blue); color: var(--blue); }
.photo-prev { max-width: 100%; max-height: 280px; border-radius: 13px; display: block; margin: 10px auto 0; }
.geo-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; }
.geo-row input { flex: 1; min-width: 170px; }
.hintline { font-size: 12.5px; color: var(--muted); margin-top: 8px; }

/* ── Сигналы ── */
.report { display: flex; gap: 13px; }
.report .thumb { width: 76px; height: 76px; flex: none; border-radius: 13px; object-fit: cover; background: var(--blue-bg); display: flex; align-items: center; justify-content: center; font-size: 26px; }
.report .body { flex: 1; min-width: 0; }
.report .rtitle { font-weight: 700; font-size: 15px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.report .rdesc { font-size: 13.5px; color: #3c455c; margin: 5px 0; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.report .rmeta { font-size: 12px; color: var(--muted); }
.status { display: inline-flex; align-items: center; border-radius: 999px; font-size: 11.5px; font-weight: 700; padding: 3.5px 10px; white-space: nowrap; }
.status.pending { background: var(--warn-bg); color: var(--warn); }
.status.approved { background: var(--ok-bg); color: var(--ok); }
.status.rejected { background: var(--red-bg); color: var(--red); }
.modnote { background: var(--bg); border-radius: 11px; padding: 9px 12px; font-size: 13px; color: #3c455c; margin-top: 9px; line-height: 1.5; }

/* ── Лидерборд ── */
.seg { display: flex; background: #e8ecf5; border-radius: 13px; padding: 4px; margin-bottom: 16px; }
.seg button { flex: 1; border: none; background: none; font-family: inherit; font-weight: 600; font-size: 13.5px; padding: 9px 10px; border-radius: 10px; cursor: pointer; color: var(--muted); transition: .15s; }
.seg button.active { background: #fff; color: var(--ink); box-shadow: 0 2px 6px rgba(0,0,0,.09); }
.lb-row { display: flex; align-items: center; gap: 12px; padding: 12px 10px; border-bottom: 1px solid var(--line); }
.lb-row:last-child { border-bottom: none; }
.lb-row.me { background: var(--blue-bg); border-radius: 13px; border-bottom-color: transparent; }
.lb-pos { width: 32px; text-align: center; font-weight: 800; font-size: 15px; color: var(--muted); flex: none; }
.lb-name { flex: 1; font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-pts { font-weight: 800; color: var(--blue); font-size: 14.5px; white-space: nowrap; }

/* ── Профиль ── */
.profile-hero {
  position: relative; overflow: hidden;
  background: linear-gradient(150deg, var(--blue-2) 0%, var(--blue-dark) 55%, var(--blue-deep) 100%);
  color: #fff; border-radius: var(--radius); padding: 24px 20px; margin-bottom: 14px;
  box-shadow: 0 12px 30px rgba(13, 76, 211, .32);
}
.profile-hero::after { content: ''; position: absolute; width: 300px; height: 300px; right: -110px; top: -140px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.16), transparent 65%); }
/* Имя и фото жителя — как они заданы в его профиле MAX. */
.me-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; position: relative; }
.me-ava { width: 52px; height: 52px; flex: none; border-radius: 50%; object-fit: cover;
  background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center;
  font-size: 21px; font-weight: 700; color: #fff; }
.me-who b { display: block; font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.me-who small { font-size: 12.5px; opacity: .8; }
.profile-hero .lvl { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.profile-hero .rt { font-size: 13.5px; opacity: .85; margin-top: 5px; line-height: 1.5; }
.bar { height: 9px; background: rgba(255,255,255,.22); border-radius: 99px; margin-top: 16px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #9fc0ff, #fff); border-radius: 99px; }
.bar-note { font-size: 12.5px; opacity: .8; margin-top: 7px; }
.stat-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
@media (min-width: 560px) { .stat-row { grid-template-columns: repeat(4, 1fr); } }
.stat-tile { background: #fff; border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow); padding: 14px 10px; text-align: center; }
.stat-tile b { display: block; font-size: 23px; letter-spacing: -.02em; }
.stat-tile span { font-size: 12px; color: var(--muted); }
.ach-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .ach-grid { grid-template-columns: repeat(3, 1fr); } }
.ach { border: 1px solid var(--line); border-radius: 15px; padding: 14px 10px; text-align: center; }
.ach.earned { border-color: #c8dbff; background: var(--blue-bg); }
.ach:not(.earned) { opacity: .45; filter: grayscale(1); }
.ach .ae { font-size: 27px; }
.ach .at { font-weight: 700; font-size: 12.5px; margin-top: 7px; }
.ach .ad { font-size: 11px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.redeem-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.redeem-item:last-child { border-bottom: none; }
.redeem-item code { background: var(--bg); border-radius: 8px; padding: 4px 9px; font-weight: 700; font-size: 13px; }

/* ── Модерация ── */
.mod-card .photo-full { width: 100%; max-height: 340px; object-fit: cover; border-radius: 13px; margin: 12px 0; }
.mod-card .nophoto { background: var(--bg); border-radius: 13px; padding: 30px; text-align: center; color: var(--muted); margin: 12px 0; }
.mod-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; margin-top: 14px; }
.mod-actions select { width: auto; flex: 1; min-width: 140px; }
.mod-actions .btn { flex: 1; min-width: 150px; }
.mod-actions input[type=text] { flex: 2; min-width: 170px; }

/* ── Админка ── */
table.adm { width: 100%; border-collapse: collapse; font-size: 14px; }
table.adm th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 6px; border-bottom: 1px solid var(--line); }
table.adm td { padding: 10px 6px; border-bottom: 1px solid var(--line); }
table.adm tr:last-child td { border-bottom: none; }
table.adm select, table.adm input { width: auto; padding: 8px 10px; font-size: 13.5px; border-radius: 10px; }
/* Заблокированный житель виден сразу, без чтения подписей. */
table.adm tr.u-blocked td { background: var(--red-bg); }
.u-ban { color: var(--red); font-size: 12px; }
.u-acts { white-space: nowrap; }
.u-acts .btn { margin-right: 6px; }

/* ── Камера (главный экран жителя) ── */
.camera-shell {
  position: relative; width: 100%; border-radius: 22px; overflow: hidden;
  background: #05070f; aspect-ratio: 3 / 4; max-height: calc(100vh - var(--nav-h) - 120px);
  box-shadow: 0 14px 40px rgba(10, 25, 70, .28); margin-top: 2px;
}
@media (min-width: 760px) { .camera-shell { aspect-ratio: 4 / 3; max-width: 560px; margin: 0 auto; max-height: none; } }
.camera-shell video { width: 100%; height: 100%; object-fit: cover; display: block; background: #05070f;
  transform-origin: center; transition: transform .06s linear; }
/* Щипок внутри видоискателя — это зум камеры, а не страницы. */
.camera-shell { touch-action: none; }
.cam-zoom { position: absolute; left: 50%; transform: translateX(-50%); top: 62px; z-index: 3;
  background: rgba(8, 12, 24, .6); color: #fff; font-size: 13px; font-weight: 700;
  padding: 5px 12px; border-radius: 99px; backdrop-filter: blur(6px); pointer-events: none; }
.camera-shell.flash::after { content: ''; position: absolute; inset: 0; background: #fff; animation: shot .26s ease-out; }
@keyframes shot { from { opacity: .9; } to { opacity: 0; } }
.cam-loading, .cam-fallback {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; color: #aab6d6; font-size: 14px; text-align: center; padding: 24px;
}
.cam-loading[hidden], .cam-fallback[hidden] { display: none; }
.cam-fallback .big { font-size: 46px; }
.cam-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,255,255,.18); border-top-color: #6ea0ff; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.cam-topbar {
  position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; gap: 12px; background: linear-gradient(180deg, rgba(0,0,0,.45), transparent);
}
.cam-hint { color: #fff; font-size: 13.5px; font-weight: 600; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.cam-torch {
  width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer; flex: none;
  background: rgba(255,255,255,.16); color: #fff; backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; transition: .15s;
}
.cam-torch.on { background: #ffd54a; color: #4a3800; box-shadow: 0 0 22px rgba(255, 213, 74, .7); }
.cam-torch.cam-torch-off { opacity: .4; }
.cam-controls {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between;
  padding: 20px 30px calc(24px + env(safe-area-inset-bottom)); background: linear-gradient(0deg, rgba(0,0,0,.5), transparent);
}
.cam-gallery {
  width: 48px; height: 48px; border-radius: 13px; border: 1.5px solid rgba(255,255,255,.5); cursor: pointer;
  background: rgba(255,255,255,.14); color: #fff; display: flex; align-items: center; justify-content: center; flex: none;
}
.cam-spacer { width: 48px; flex: none; }
.cam-shutter {
  width: 74px; height: 74px; border-radius: 50%; border: none; cursor: pointer; flex: none;
  background: rgba(255,255,255,.28); padding: 5px; display: flex; align-items: center; justify-content: center; transition: .12s;
}
.cam-shutter span { width: 100%; height: 100%; border-radius: 50%; background: #fff; display: block; box-shadow: inset 0 0 0 3px #05070f; }
.cam-shutter:active { transform: scale(.92); }

/* ── Форма деталей ── */
.form-top { display: flex; align-items: center; gap: 10px; margin: 2px 0 16px; }
.icon-back {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: var(--ink); flex: none; box-shadow: var(--shadow);
}
.icon-back:active { transform: scale(.94); }
.shot-wrap { position: relative; margin-bottom: 14px; }
.shot { width: 100%; max-height: 320px; object-fit: cover; border-radius: 18px; display: block; box-shadow: var(--shadow); }
.shot-retake {
  position: absolute; right: 12px; bottom: 12px; border: none; cursor: pointer; font-family: inherit;
  background: rgba(10,18,40,.7); color: #fff; font-size: 13px; font-weight: 600; padding: 9px 14px; border-radius: 11px; backdrop-filter: blur(6px);
}

/* ── Успех ── */
.success {
  text-align: center; padding: 32px 20px; max-width: 440px; margin: 12px auto 0;
  opacity: 0; transform: translateY(16px); transition: .45s cubic-bezier(.3,.9,.3,1);
}
.success.show { opacity: 1; transform: none; }
.success-check { width: 96px; height: 96px; margin: 0 auto 22px; }
.success-check svg { width: 100%; height: 100%; }
.sc-ring { fill: none; stroke: var(--ok); stroke-width: 3; stroke-dasharray: 145; stroke-dashoffset: 145; animation: draw .6s .1s ease-out forwards; }
.sc-tick { fill: none; stroke: var(--ok); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .4s .55s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.success h2 { font-size: 24px; letter-spacing: -.02em; margin-bottom: 10px; }
.success p { color: var(--muted); font-size: 15px; line-height: 1.6; margin-bottom: 22px; }
.success-badge {
  display: inline-flex; flex-direction: column; gap: 3px; align-items: center;
  background: linear-gradient(130deg, var(--blue-2), var(--blue-dark)); color: #fff;
  border-radius: 16px; padding: 16px 34px; margin-bottom: 26px; box-shadow: 0 10px 26px rgba(13,76,211,.3);
}
.success-badge span { font-size: 12px; opacity: .8; }
.success-badge b { font-size: 26px; letter-spacing: -.02em; }
.success-actions { display: flex; flex-direction: column; gap: 10px; }

/* ── Тосты ── */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(90px);
  background: var(--ink); color: #fff; border-radius: 14px; padding: 13px 20px;
  font-size: 14px; font-weight: 500; opacity: 0; transition: .28s cubic-bezier(.3,.9,.3,1);
  z-index: 99; max-width: min(90vw, 420px); text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.ok { background: var(--ok); }
#toast.err { background: var(--red); }
@media (min-width: 760px) { #toast { bottom: 26px; } }

/* ── Баннер установки PWA ── */
#pwaBanner {
  position: fixed; left: 12px; right: 12px; z-index: 60;
  bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom));
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 14px 40px rgba(10, 25, 70, .22);
  padding: 13px 14px; display: flex; align-items: center; gap: 12px;
  transform: translateY(140%); opacity: 0; transition: .35s cubic-bezier(.3, .9, .3, 1);
  max-width: 440px; margin: 0 auto;
}
body.landing #pwaBanner { bottom: calc(14px + env(safe-area-inset-bottom)); }
#pwaBanner.show { transform: none; opacity: 1; }
#pwaBanner .pwa-ic { width: 46px; height: 46px; border-radius: 13px; flex: none; background: linear-gradient(140deg, var(--blue-2), var(--blue-dark)); display: flex; align-items: center; justify-content: center; }
#pwaBanner .pwa-tx { flex: 1; min-width: 0; }
#pwaBanner .pwa-t { font-weight: 700; font-size: 14px; }
#pwaBanner .pwa-s { font-size: 12px; color: var(--muted); margin-top: 1px; }
#pwaBanner .pwa-install { border: none; cursor: pointer; font-family: inherit; background: var(--blue); color: #fff; font-weight: 700; font-size: 13.5px; padding: 10px 16px; border-radius: 12px; flex: none; }
#pwaBanner .pwa-close { border: none; cursor: pointer; background: none; color: var(--muted); font-size: 20px; line-height: 1; padding: 6px; flex: none; }
#pwaHint {
  position: fixed; inset: 0; z-index: 70; background: rgba(10, 18, 40, .5);
  display: flex; align-items: flex-end; justify-content: center;
}
#pwaHint .hint-card {
  background: #fff; border-radius: 22px 22px 0 0; padding: 24px 22px calc(28px + env(safe-area-inset-bottom));
  max-width: 440px; width: 100%; font-size: 14.5px; line-height: 1.65;
}
#pwaHint .hint-card h3 { margin-bottom: 10px; font-size: 17px; }
#pwaHint .hint-card .btn { width: 100%; margin-top: 16px; }

/* ── Баллы при одобрении (модерация) ── */
.award-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.award-lbl { font-size: 13px; font-weight: 700; color: #3c455c; }
.award-row .award { width: 86px; flex: none; text-align: center; font-weight: 700; }
.pts-chip {
  border: 1.5px solid var(--line); background: #fff; border-radius: 999px; cursor: pointer;
  padding: 8px 13px; font-family: inherit; font-weight: 700; font-size: 13px; color: var(--blue); transition: .12s;
}
.pts-chip:active { transform: scale(.94); background: var(--blue-bg); }

/* ── Админка: строки категорий ── */
.adm-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 9px 0; border-bottom: 1px solid var(--line); }
.adm-row:last-of-type { border-bottom: none; }
.adm-row.inactive { opacity: .5; }
.adm-row input[type=text] { flex: 1; min-width: 130px; padding: 10px 12px; font-size: 14px; }
.adm-row .btn-sm { flex: none; padding: 9px 11px; }
.emoji-in { width: 62px !important; min-width: 62px !important; flex: none !important; text-align: center; }

/* ── Вход по e-mail (OTP) на лендинге ── */
.otp-toggle {
  border: none; background: none; cursor: pointer; font-family: inherit;
  color: #9db4e8; font-size: 13.5px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
}
.otp-toggle:hover { color: #fff; }
.otp-card {
  width: 100%; max-width: 380px; margin: 6px auto 0; background: #fff; border-radius: 18px;
  padding: 20px 18px; text-align: left; box-shadow: 0 14px 40px rgba(0, 10, 50, .35); color: var(--ink);
}
.otp-card h3 { font-size: 16px; margin-bottom: 4px; }
.otp-card .sub { font-size: 13px; color: var(--muted); margin-bottom: 12px; line-height: 1.5; }
.otp-card .btn { width: 100%; margin-top: 12px; }
.otp-card input { letter-spacing: .02em; }
.otp-card .code-in { text-align: center; font-size: 22px; font-weight: 700; letter-spacing: .35em; }
.otp-demo {
  background: var(--warn-bg); color: var(--warn); border-radius: 11px; padding: 9px 12px;
  font-size: 13px; font-weight: 600; margin-top: 10px; text-align: center;
}
.otp-err { color: var(--red); font-size: 13px; margin-top: 8px; }
