/* Whoosh Maps — оболочка интерфейса по образцу Яндекс.Народной карты.
   Акцент #FF6A48 живёт только здесь, в хроме. На геометрию карты он не идёт:
   там оранжевый должен означать конкретный тип объекта. */

@font-face {
  font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url("/fonts-ui/inter-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url("/fonts-ui/inter-cyrillic-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url("/fonts-ui/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url("/fonts-ui/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --accent: #FF6A48;
  --panel: #fff;
  --text: #1f1d1a;
  --muted: #6a635a;
  --hairline: rgba(0, 0, 0, .1);
  --shadow: 0 2px 10px rgba(0, 0, 0, .16);
  --radius: 10px;
}

* { box-sizing: border-box; }

/* Атрибут hidden прячет элемент правилом display:none из браузерного стиля, и любое
   авторское display его перебивает. Один раз на всю страницу, иначе каждый новый
   блок с display:flex молча остаётся на экране: так у неавторизованных были видны
   и «Создать», и переключатель служебной информации. */
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); }
button { font: inherit; }
#map { position: absolute; inset: 0; }

.panel { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---- верхняя панель ---- */
.topbar {
  position: absolute; top: 12px; left: 12px; right: 12px; z-index: 4;
  display: flex; align-items: flex-start; gap: 10px; pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 8px; padding: 9px 13px; font-weight: 700; font-size: 14px; }
.brand img { height: 18px; width: auto; display: block; }
.topbar__spacer { flex: 1; pointer-events: none; }

.btn-create {
  display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 16px;
  border: 0; border-radius: var(--radius); background: var(--accent); color: #fff;
  font-weight: 600; font-size: 14px; cursor: pointer; box-shadow: var(--shadow);
}
.btn-create[aria-pressed="true"] { background: #d4482a; }
.btn-create svg { width: 15px; height: 15px; }

.profile { position: relative; }
.profile__btn {
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 13px;
  border: 0; border-radius: var(--radius); background: var(--panel); color: var(--text);
  font-weight: 600; font-size: 14px; cursor: pointer; box-shadow: var(--shadow);
}
.profile__menu {
  position: absolute; top: 44px; right: 0; min-width: 176px; padding: 5px;
  background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow);
}
.profile__menu button {
  display: block; width: 100%; padding: 9px 11px; border: 0; background: transparent;
  border-radius: 7px; text-align: left; font-size: 14px; color: var(--text); cursor: pointer;
}
.profile__menu button:hover { background: rgba(0, 0, 0, .05); }

/* ---- левая колонка инструментов ---- */
.tools { position: absolute; top: 62px; left: 12px; z-index: 3; display: flex; flex-direction: column; gap: 8px; }
.tool {
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: var(--radius); background: var(--panel); color: var(--text);
  cursor: pointer; box-shadow: var(--shadow);
}
.tool svg { width: 18px; height: 18px; }
.tool[aria-pressed="true"] { background: var(--accent); color: #fff; }
.tool-group { display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.tool-group .tool { border-radius: 0; box-shadow: none; }
.tool-group .tool + .tool { border-top: 1px solid var(--hairline); }

/* ---- правая нижняя колонка ---- */
.tools-right { position: absolute; right: 12px; bottom: 46px; z-index: 3; display: flex; flex-direction: column; gap: 8px; }

/* ---- нижняя строка: масштаб слева от копирайта, поверх ничего не лежит ---- */
.footer {
  position: absolute; right: 10px; bottom: 8px; z-index: 3;
  display: flex; align-items: center; gap: 12px;
  font-size: 11px; color: var(--muted);
}
.scale { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.scale__bar { height: 5px; border: 1px solid rgba(0, 0, 0, .45); border-top: 0; background: rgba(255, 255, 255, .5); }
.scale__label { line-height: 1; }
.attribution { background: rgba(255, 255, 255, .78); padding: 2px 6px; border-radius: 4px; }

/* ---- переключатель подложки ---- */
.basemap { position: absolute; left: 12px; bottom: 12px; z-index: 3; display: flex; overflow: hidden; }
.basemap button { border: 0; background: transparent; padding: 9px 15px; font-size: 13px; color: var(--text); cursor: pointer; }
.basemap button + button { border-left: 1px solid var(--hairline); }
.basemap button[aria-pressed="true"] { background: var(--accent); color: #fff; font-weight: 600; }

/* ---- панель слоёв ---- */
.layers { position: absolute; top: 62px; left: 62px; z-index: 3; width: 236px; padding: 12px; }
.layers__title { font-weight: 700; font-size: 13px; margin-bottom: 9px; }
.layers__divider { margin: 10px 0 8px; border-top: 1px solid var(--hairline); }

/* Свои чекбоксы: у системного нельзя задать ни размер, ни цвет галочки, и в разных
   браузерах он выглядит по-разному. Рисуем сами, галочку — фоновым SVG. */
.check { display: flex; align-items: center; gap: 9px; padding: 5px 0; font-size: 13px; cursor: pointer; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check__box {
  width: 17px; height: 17px; flex: none; border: 1.5px solid #c6c0b8; border-radius: 5px;
  background: #fff; transition: background .12s, border-color .12s;
}
.check input:checked + .check__box {
  background: var(--accent) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8.5l3.2 3.2L13 5'/%3E%3C/svg%3E") center/12px no-repeat;
  border-color: var(--accent);
}
.check input:focus-visible + .check__box { outline: 2px solid var(--accent); outline-offset: 2px; }
.check__dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.check--strong { font-weight: 600; }

/* ---- карточка объекта ---- */
.card { position: absolute; top: 62px; right: 12px; z-index: 4; width: 312px; padding: 14px; }
.card__close { position: absolute; top: 8px; right: 10px; border: 0; background: transparent; font-size: 20px; line-height: 1; color: var(--muted); cursor: pointer; }
.card__head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; }
.card__dot { width: 12px; height: 12px; border-radius: 4px; }
.card__name { margin-top: 6px; font-size: 15px; }
.card__props { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; }
.card__props td { padding: 4px 0; vertical-align: top; }
.card__props td:first-child { color: var(--muted); width: 44%; }
.card__foot { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--hairline); font-size: 11px; color: var(--muted); }

/* ---- создание объекта ---- */
.create { position: absolute; top: 62px; right: 12px; z-index: 5; width: 312px; padding: 14px; }
.create__title { font-weight: 700; font-size: 14px; margin-bottom: 10px; }
.create__types { display: flex; flex-direction: column; gap: 2px; max-height: 40vh; overflow-y: auto; }
.create__type {
  display: flex; align-items: center; gap: 9px; padding: 8px 9px; border: 0; border-radius: 7px;
  background: transparent; text-align: left; font-size: 13px; color: var(--text); cursor: pointer;
}
.create__type:hover { background: rgba(0, 0, 0, .05); }
.create__type[aria-pressed="true"] { background: rgba(255, 106, 72, .12); font-weight: 600; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 9px; font-size: 12px; color: var(--muted); }
.field input, .field textarea {
  font: inherit; font-size: 14px; color: var(--text); padding: 8px 10px;
  border: 1px solid var(--hairline); border-radius: 8px; background: #fff;
}
.field textarea { resize: vertical; min-height: 56px; }
.row { display: flex; gap: 8px; margin-top: 4px; }
.btn {
  flex: 1; height: 38px; display: flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: 8px; font-weight: 600; font-size: 14px; cursor: pointer;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--ghost { background: transparent; border-color: var(--hairline); color: var(--text); }
.btn[disabled] { opacity: .55; cursor: default; }

/* Подсказка режима рисования — узкая полоса сверху, как в НК. */
.drawbar {
  position: absolute; top: 62px; left: 50%; transform: translateX(-50%); z-index: 5;
  display: flex; align-items: center; gap: 12px; padding: 9px 14px;
  background: #2b2621; color: #fff; font-size: 13px; border-radius: var(--radius); box-shadow: var(--shadow);
}
.drawbar button { border: 0; background: rgba(255, 255, 255, .16); color: #fff; padding: 5px 10px; border-radius: 6px; cursor: pointer; font-size: 12px; }

.toast {
  position: absolute; top: 62px; left: 50%; transform: translateX(-50%); z-index: 6;
  background: #2b2621; color: #fff; font-size: 13px; padding: 8px 14px; border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---- вход ---- */
.login {
  position: absolute; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(28, 25, 22, .55); backdrop-filter: blur(3px);
}
.login__box { width: min(360px, 100%); padding: 24px; text-align: center; }
.login__logo { height: 26px; width: auto; }
.login__title { margin: 12px 0 6px; font-size: 19px; }
.login__text { margin: 0 0 18px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.login__btn {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 46px;
  border: 1px solid transparent; border-radius: var(--radius); background: var(--accent);
  color: #fff; text-decoration: none; font-weight: 600; font-size: 15px; line-height: 1; cursor: pointer;
}
.login__note { margin: 14px 0 10px; font-size: 11px; color: #8a827a; }
.login__btn--ghost { border-color: var(--hairline); background: transparent; color: var(--text); }

@media (max-width: 720px) {
  .layers { left: 12px; right: 12px; top: auto; bottom: 62px; width: auto; }
  .card, .create { left: 12px; right: 12px; top: auto; bottom: 12px; width: auto; }
  .brand span { display: none; }
}

/* ---- контекстное меню по правому клику ---- */
.ctxmenu { position: absolute; z-index: 7; min-width: 220px; padding: 5px; }
.ctxmenu button {
  display: block; width: 100%; padding: 9px 11px; border: 0; background: transparent;
  border-radius: 7px; text-align: left; font-size: 13px; color: var(--text); cursor: pointer;
}
.ctxmenu button:hover { background: rgba(0, 0, 0, .05); }
.ctxmenu button[disabled] { color: var(--muted); cursor: default; }
.ctxmenu button[disabled]:hover { background: transparent; }
.ctxmenu__sep { margin: 4px 0; border-top: 1px solid var(--hairline); }

.suggest__hint { margin: 0 0 10px; font-size: 12px; line-height: 1.4; color: var(--muted); }
.field select {
  font: inherit; font-size: 14px; color: var(--text); padding: 8px 10px;
  border: 1px solid var(--hairline); border-radius: 8px; background: #fff;
}

/* ---- очередь предложений ---- */
.queue { position: absolute; top: 62px; right: 12px; z-index: 5; width: 340px; max-height: 72vh; padding: 14px; overflow-y: auto; }
.queue__list { display: flex; flex-direction: column; gap: 8px; }
.queue__item { border: 1px solid var(--hairline); border-radius: 9px; padding: 10px; }
.queue__meta { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.queue__text { font-size: 13px; line-height: 1.4; }
.queue__row { display: flex; gap: 6px; margin-top: 9px; }
.queue__row button { flex: 1; height: 32px; border-radius: 7px; border: 1px solid var(--hairline); background: transparent; font-size: 12px; cursor: pointer; }
.queue__row button.accept { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.queue__empty { font-size: 13px; color: var(--muted); }
#queue-count { font-weight: 700; color: var(--accent); }
