/* Единый вход и аккаунт Peleng Maps (account.js): окно входа и окно аккаунта.
 * Подключается и на карте, и на портале, и на главной. Тёмный вариант — при body.theme-dark.
 * Класс .au-win перекрашивает и прежние окна карты (правки, жалоба, избранное). */
:root { --c-surface: #fff; --c-ink: #172033; --c-mut: #64748b; --c-line: rgba(15, 23, 42, .1); --c-acc: #0969da; --c-soft: #eaf2fd; --c-soft2: #f4f7fb }
body.theme-dark { --c-surface: #172134; --c-ink: #e6ecf5; --c-mut: #94a3b8; --c-line: rgba(255, 255, 255, .1); --c-acc: #4da3ff; --c-soft: #1f3556; --c-soft2: #1d2a42 }

/* ================= окно входа (contrib.js) ================= */
.au-ov { position: fixed; inset: 0; z-index: 5000; background: rgba(15, 23, 42, .55); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 16px }
.au-card { position: relative; width: 100%; max-width: 410px; max-height: calc(100vh - 32px); overflow: auto;
  background: #fff; color: #1b2433; border-radius: 18px; padding: 26px 26px 22px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .35); font: 15px/1.4 system-ui, -apple-system, Segoe UI, Roboto, sans-serif }
.au-x { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: transparent; color: #6b7a90; font-size: 17px; cursor: pointer }
.au-x:hover { background: rgba(120, 130, 150, .15) }
.au-head { display: flex; align-items: center; gap: 8px; justify-content: center; margin-bottom: 6px; color: #0969da }
.au-logo { display: flex }
.au-brand { font-weight: 800; font-size: 18px; letter-spacing: .2px }
.au-t { margin: 8px 0 2px; text-align: center; font-size: 21px }
.au-s { margin: 0 0 12px; text-align: center; color: #5b6b82; font-size: 14px }
.au-tabs { display: flex; gap: 4px; background: #eef2f7; border-radius: 12px; padding: 4px; margin: 14px 0 6px }
.au-tabs button { flex: 1; height: 38px; border: 0; border-radius: 9px; background: transparent; color: #4a5a72;
  font: 600 14px/1 inherit; cursor: pointer }
.au-tabs button.on { background: #fff; color: #0969da; box-shadow: 0 1px 4px rgba(0, 0, 0, .15) }
.au-form { display: flex; flex-direction: column; gap: 10px; margin-top: 8px }
.au-f { display: flex; flex-direction: column; gap: 4px }
.au-l { font-size: 12.5px; color: #5b6b82 }
.au-r { position: relative; display: block }
.au-r input { width: 100%; font: 16px/1.3 inherit; padding: 12px 13px; border-radius: 11px; border: 1px solid #cfd8e4;
  background: #fff; color: #1b2433; outline: none }
.au-r input:focus { border-color: #0969da; box-shadow: 0 0 0 3px rgba(9, 105, 218, .15) }
.au-r input.bad { border-color: #d93a3a }
.au-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0;
  background: transparent; color: #6b7a90; cursor: pointer; border-radius: 10px; display: flex; align-items: center; justify-content: center }
.au-fe { color: #d93a3a; font-size: 13px; min-height: 0 }
.au-fe:empty { display: none }
.au-fr { text-align: right; margin-top: -2px }
.au-a { color: #0969da; text-decoration: none; font-size: 13.5px }
.au-a:hover { text-decoration: underline }
.au-msg { color: #d93a3a; font-size: 13.5px }
.au-msg:empty { display: none }
.au-go { height: 50px; border: 0; border-radius: 13px; background: #0969da; color: #fff; font: 700 16px/1 inherit;
  cursor: pointer; margin-top: 2px; touch-action: manipulation }
.au-go:hover { filter: brightness(1.08) }
.au-go:disabled { opacity: .65; cursor: default }
.au-go.busy::after { content: ''; display: inline-block; width: 14px; height: 14px; margin-left: 9px; vertical-align: -2px;
  border: 2px solid rgba(255, 255, 255, .5); border-top-color: #fff; border-radius: 50%; animation: au-spin .7s linear infinite }
@keyframes au-spin { to { transform: rotate(360deg) } }
.au-lic { color: #6b7a90; font-size: 12px; line-height: 1.4 }
.au-or { display: flex; align-items: center; gap: 10px; color: #8a97ab; font-size: 13px; margin: 14px 0 10px }
.au-or::before, .au-or::after { content: ''; flex: 1; height: 1px; background: #dfe5ee }
.au-prov { display: flex; flex-direction: column; gap: 8px }
.au-pv { height: 46px; border-radius: 12px; border: 1px solid #cfd8e4; background: #fff; color: #1b2433; font: 600 15px/1 inherit; cursor: pointer }
.au-pv:hover { background: #f4f7fb }
.au-pv b { font-size: 17px; margin-right: 4px }
.au-foot { margin: 14px 0 0; text-align: center; color: #5b6b82; font-size: 14px }
.au-done { display: flex; justify-content: center; color: #0969da; margin: 6px 0 4px }
body.theme-dark .au-card { background: #111a2c; color: #eaf0f8; box-shadow: 0 24px 70px rgba(0, 0, 0, .7) }
body.theme-dark .au-head, body.theme-dark .au-a, body.theme-dark .au-done { color: #5aa2ff }
body.theme-dark .au-s, body.theme-dark .au-l, body.theme-dark .au-foot { color: #9db0c8 }
body.theme-dark .au-tabs { background: #0b1220 }
body.theme-dark .au-tabs button { color: #9db0c8 }
body.theme-dark .au-tabs button.on { background: #1b2842; color: #fff }
body.theme-dark .au-r input { background: #0b1220; border-color: #2a3550; color: #fff }
body.theme-dark .au-r input.bad { border-color: #ff6b6b }
body.theme-dark .au-fe, body.theme-dark .au-msg { color: #ff8b8b }
body.theme-dark .au-pv { background: #0b1220; border-color: #2a3550; color: #eaf0f8 }
body.theme-dark .au-or::before, body.theme-dark .au-or::after { background: #2a3550 }
body.theme-dark .au-lic, body.theme-dark .au-x, body.theme-dark .au-eye { color: #9db0c8 }
@media (max-width: 600px) {
  .au-ov { padding: 0; align-items: stretch }
  .au-card { max-width: none; max-height: none; height: 100%; border-radius: 0; padding: 56px 20px calc(24px + env(safe-area-inset-bottom, 0px)) }
}

/* ================= единое окно аккаунта ================= */
/* Окна contrib.js и ui.js (аккаунт, правки, форма места, жалоба, избранное)
   — того же вида, что окно входа. Старые тёмные классы as-… и c-… внутри
   карточки перекрашены; тёмный вариант — при theme-dark. */
.au-sh { display: none }
.au-sh.show { display: flex }
.au-win { padding: 22px 20px 20px }
.au-win { --au-bg: #fff }
body.theme-dark .au-win { --au-bg: #111a2c }
/* шапка с заголовком и ✕ закреплена: при прокрутке формы закрыть можно всегда */
.au-win .as-head { position: sticky; top: -22px; z-index: 4; display: flex; align-items: center; gap: 6px;
  margin: -22px -20px 10px; padding: 18px 60px 12px 20px; border: 0; background: var(--au-bg) }
.au-win .as-head .au-x { position: absolute; top: 50%; right: 12px; transform: translateY(-50%) }
.au-win .as-head b { overflow-wrap: anywhere }
/* окно входа: ✕ тоже не уезжает */
.au-card > .au-x { position: sticky; top: 0; float: right; margin: -14px -12px -28px 8px; z-index: 4 }
.au-two { display: flex; gap: 10px }
.au-btn2 { flex: 1; height: 44px; border-radius: 12px; border: 1px solid #cfd8e4; background: transparent; color: inherit; font: 700 15px/1 inherit; cursor: pointer }
.au-btn2.red { background: #d93a3a; border-color: #d93a3a; color: #fff }
body.theme-dark .au-btn2 { border-color: #2a3550 }
body.theme-dark .au-btn2.red { border-color: #d93a3a }
/* фото в форме: своя кнопка и превью с ✕ вместо системного «Выберите файл» */
.c-ph { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 12px }
.c-ph-add { height: 44px; padding: 0 16px; border-radius: 12px; border: 1.5px dashed #9db0c8; background: transparent; color: #0969da; font: 700 15px/1 inherit; cursor: pointer }
body.theme-dark .c-ph-add { color: #5aa2ff; border-color: #3a4b6b }
.c-ph-t { position: relative; width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: #e3e9f1 }
.c-ph-t img { width: 100%; height: 100%; object-fit: cover; display: block }
.c-ph-t button { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff; font-size: 12px; line-height: 1; cursor: pointer; padding: 0 }
.c-btns { display: flex; gap: 10px; margin-top: 6px }
.c-btns .c-go, .c-btns .c-cancel { flex: 1 }
.c-cancel { height: 50px; border-radius: 13px; border: 1px solid #cfd8e4; background: transparent; color: inherit; font: 600 16px/1 inherit; cursor: pointer }
body.theme-dark .c-cancel { border-color: #2a3550 }
.au-win .as-head b { flex: 1; font-size: 19px; font-weight: 700 }
.au-back { width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: #0969da;
  font-size: 26px; line-height: 1; cursor: pointer }
.au-back:hover { background: rgba(120, 130, 150, .15) }
.au-win .as-body { overflow: visible }
.au-hint { margin: 2px 0 4px; text-align: center; color: #5b6b82; font-size: 14px }
.au-g { display: flex; justify-content: center; min-height: 44px }
.au-prof { display: flex; align-items: center; gap: 14px; padding: 4px 36px 14px 0 }
.au-ava, .pf-ava { display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #0969da; color: #fff; font-weight: 700 }
.au-ava { width: 52px; height: 52px; font-size: 22px; flex: none }
.au-pi { display: flex; flex-direction: column; min-width: 0 }
.au-pi b { font-size: 18px; overflow: hidden; text-overflow: ellipsis }
.au-pi span { color: #5b6b82; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis }
.au-acts { display: flex; flex-direction: column; border-top: 1px solid #e3e9f1 }
.au-act { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 4px; border: 0; border-bottom: 1px solid #e3e9f1;
  background: transparent; color: inherit; text-align: left; font: inherit; cursor: pointer; touch-action: manipulation }
.au-act:hover { background: rgba(9, 105, 218, .06) }
.au-ai { width: 32px; display: flex; justify-content: center; color: #0969da; flex: none }
.au-out .au-ai { color: inherit }
body.theme-dark .au-ai { color: #5aa2ff }
body.theme-dark .au-out .au-ai { color: inherit }
.au-at { flex: 1; min-width: 0; display: flex; flex-direction: column }
.au-at b { font-weight: 600; font-size: 15.5px }
.au-at small { color: #5b6b82; font-size: 12.5px; margin-top: 1px }
.au-at small:empty { display: none }
.au-ch { color: #9aa7ba; font-size: 22px }
.au-out { color: #d93a3a }
.au-out .au-ch { display: none }
/* старые тёмные классы внутри окна */
.au-win .c-form { padding: 6px 0 0 }
.au-win .c-f { color: #5b6b82 }
.au-win .c-f input, .au-win .c-f select, .au-win .c-f textarea { background: #fff; color: #1b2433; border: 1px solid #cfd8e4; border-radius: 11px }
.au-win .c-f input:focus, .au-win .c-f select:focus, .au-win .c-f textarea:focus { border-color: #0969da; box-shadow: 0 0 0 3px rgba(9, 105, 218, .15) }
.au-win .c-go { background: #0969da; color: #fff; border-radius: 13px }
.au-win .c-go:disabled { background: #0969da; opacity: .6 }
.au-win .c-close { color: #d93a3a; border-color: #f1c7c7; background: transparent }
.au-win .c-err { color: #d93a3a }
.au-win .c-lic, .au-win .c-loc { color: #5b6b82 }
.au-win .c-rs { background: #f4f7fb; border-color: #dfe5ee; color: #1b2433 }
.au-win .as-it { color: inherit; border-bottom: 1px solid #e3e9f1; padding: 12px 2px }
.au-win .as-it:active { background: rgba(9, 105, 218, .06) }
.au-win .as-grp { color: #5b6b82; padding: 12px 2px 4px }
.au-win .as-tx span { color: #5b6b82 }
.au-win .as-foot { color: #5b6b82; border-top: 0; padding: 12px 2px }
.au-win .as-sw { background: #cfd8e4 }
.au-win .as-sw.on { background: #0969da }
.au-win .c-st { background: #eef2f7; color: #4a5a72 }
.au-win .c-st.c-applied { background: #dcf6e6; color: #1a7f4b }
.au-win .c-st.c-rejected { background: #fde2e2; color: #b42a2a }
.au-win .sv-del { color: #6b7a90 }
.au-win .sv-del:active { background: rgba(120, 130, 150, .15) }
body.theme-dark .au-win .au-back, body.theme-dark .au-ch { color: #9db0c8 }
body.theme-dark .au-hint, body.theme-dark .au-pi span, body.theme-dark .au-at small { color: #9db0c8 }
body.theme-dark .au-acts, body.theme-dark .au-act, body.theme-dark .au-win .as-it { border-color: #243049 }
body.theme-dark .au-act:hover { background: rgba(90, 162, 255, .1) }
body.theme-dark .au-out { color: #ff8b8b }
body.theme-dark .au-win .c-f { color: #9db0c8 }
body.theme-dark .au-win .c-f input, body.theme-dark .au-win .c-f select, body.theme-dark .au-win .c-f textarea { background: #0b1220; border-color: #2a3550; color: #fff }
body.theme-dark .au-win .c-lic, body.theme-dark .au-win .c-loc, body.theme-dark .au-win .as-grp, body.theme-dark .au-win .as-tx span, body.theme-dark .au-win .as-foot { color: #9db0c8 }
body.theme-dark .au-win .c-rs { background: #0b1220; border-color: #2a3550; color: #eaf0f8 }
body.theme-dark .au-win .c-close { border-color: #5a2a35; color: #f0a5a5 }
body.theme-dark .au-win .as-sw { background: #2a3550 }
body.theme-dark .au-win .c-st { background: #223354; color: #c3d6ea }
body.theme-dark .au-win .c-st.c-applied { background: #123d24; color: #7ee2a8 }
body.theme-dark .au-win .c-st.c-rejected { background: #4a1d24; color: #ff9a9a }
body.theme-dark .au-win .sv-del { color: #9db0c8 }

.au-lang { display: flex; justify-content: center; margin-top: 14px }

/* вопрос «Закрыть без сохранения?» — небольшая карточка по центру, в т.ч. на телефоне */
.au-ov.au-conf { align-items: center; padding: 16px }
.au-conf .au-card { height: auto; max-height: none; border-radius: 18px; padding: 20px; max-width: 340px }
.c-consent { margin: 10px 0 2px; font-size: 12px; line-height: 1.4; opacity: .72 }
/* касания: зона нажатия не меньше 44×44, без задержки 300 мс */
.au-x { width: 44px; height: 44px; top: 6px; right: 6px }
.au-eye { width: 44px; height: 44px }
.au-a { display: inline-block; padding: 13px 6px; margin: -13px -6px }
.au-act, .au-card button, .au-card a, .au-card select, .au-card input { touch-action: manipulation; -webkit-tap-highlight-color: transparent }

.lp-b, .lp-o { min-height: 44px; touch-action: manipulation; -webkit-tap-highlight-color: transparent }
