/* Shared by Sidebar in the application and on public pages. */
/* ============================================================================
   panels/drawer.css — левый drawer, навигация, переключатель темы, оболочка panelview
   Извлечено из panels.css (см. panels/index.css). Порядок @import = каскад. */

/* ---------- Left drawer — partition wall ---------- */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 1500;
  background: rgba(11, 11, 11, 0);
  visibility: hidden;
  transition:
    background 0.3s ease,
    visibility 0s linear 0.3s;
}

.drawer--open {
  background: rgba(11, 11, 11, 0.32);
  visibility: visible;
  transition: background 0.3s ease;
}

.drawer__panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(82vw, 300px);
  padding: calc(var(--safe-t) + 22px) 18px calc(var(--safe-b) + 18px);
  background: var(--bg);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 24px;
  transform: translateX(-100%);
  transition: transform 0.32s var(--ease-snap);
}

.drawer--open .drawer__panel {
  transform: translateX(0);
}

.drawer__brand {
  /* На ПК знак — ссылка на главную афиши (Sidebar), на телефоне — кнопка «на карту».
     Ссылочные украшения гасим: выглядеть он обязан одинаково в обоих случаях. */
  text-decoration: none;
  cursor: pointer;
  font-family: var(--display);
  font-weight: 800;
  font-size: 30px;
  letter-spacing: -0.04em;
  text-transform: lowercase;
  color: var(--ink);
}

.drawer__brand::after {
  content: "";
  display: block;
  width: 100%;
  height: 1px;
  margin-top: 10px;
  background: var(--line);
}

.drawer__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.navitem {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 50px;
  padding: 0 6px;
  border: 0;
  border-top: 1px solid var(--line-soft);
  background: none;
  color: var(--ink-dim);
  font-family: var(--grotesk);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-align: left;
  cursor: pointer;
}

.navitem__glyph {
  width: 22px;
  flex: 0 0 22px;
  display: grid;
  place-items: center;
  color: var(--ink-faint);
}

.navitem--active {
  color: var(--ink);
}

.navitem--active .navitem__glyph {
  color: var(--ink);
}

.navitem--active::before {
  content: "";
  position: absolute;
  left: 0;
  width: 4px;
  height: 22px;
  background: var(--acid);
  box-shadow: 0 0 0 1px var(--ink);
}

.navitem {
  position: relative;
}

.navitem__badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--mono);
  font-size: var(--fs-label);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 1px var(--ink);
}

/* Заблокированная (аккаунт-)вкладка у веб-гостя: приглушена + замок справа. Клик ведёт в форму
   входа (не disabled-атрибут — иначе не поймать клик), поэтому cursor остаётся кликабельным. */
/* Account block — replaces the «Профиль» nav item; opens the profile/settings screen. Pinned to the
   bottom group (avatar · @handle · ›), Linear/Slack-style. */
/* Нижняя группа (TG-строка + профиль) — ОДИН margin-top:auto пиннит её вниз целиком.
   NB: имя НЕ .drawer__foot (та уже занята mono/uppercase-футером ниже в файле).
   flex-column → дети (кнопка профиля/TG-строка) РАСТЯГИВАЮТСЯ на всю ширину, иначе <button> внутри
   блока сжимается по контенту и линия-разделитель над профилем короче вкладок (видно на мобилке). */
.drawer__btm {
  margin-top: auto;
  display: flex;
  flex-direction: column;
}
.drawer__account {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 76px;
  padding: 0 6px;
  border: 0;
  border-top: 1px solid var(--line-soft);
  background: none;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.drawer__account:active {
  background-image: linear-gradient(var(--press), var(--press));
}
.drawer__avatar {
  width: 44px;
  height: 44px;
  flex: none;
  /* #26: квадрат + inset ink-keyline + acid-заливка плейсхолдера — единый вид с .profile__avatar
     (был круг с acid-кольцом). Фото задаётся инлайн через background-image поверх заливки. */
  border-radius: 0;
  background: var(--vitrine) center/cover no-repeat;
  box-shadow: inset 0 0 0 1px var(--ink);
  display: grid;
  place-items: center;
  font-family: var(--grotesk);
  font-weight: 700;
  font-size: 17px;
  color: var(--on-acid);
}
.drawer__account-id {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.drawer__handle {
  font-family: var(--grotesk);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
  /* Длинное имя/почта не должны вылезать за рейл — режем многоточием. */
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.drawer__account-cap {
  font-family: var(--grotesk);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.drawer__account-go {
  margin-left: auto;
  font-size: 22px;
  line-height: 1;
  color: var(--ink-faint);
}
.drawer__account--active .drawer__avatar {
  box-shadow: 0 0 0 1.5px var(--ink);
}

/* Веб-режим: «Окрест есть в Telegram» — напоминания/подборки шлёт только бот, поэтому мягко зовём
   веб-юзера открыть апп в Telegram. Структура ЗЕРКАЛИТ блок профиля (квадрат-бейдж 44px + текст),
   чтобы две нижние строки стояли ровно по одной сетке. margin-top:auto пиннит нижнюю группу вниз
   (в TG-режиме блока нет — профиль пиннит себя сам). Внутри Telegram не рендерится. */
.drawer__tg {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 6px 15px;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.drawer__tg:active {
  background-image: linear-gradient(var(--press), var(--press));
}
.drawer__tg-title {
  font-family: var(--grotesk);
  font-size: 13px;
  font-weight: 700;
  /* line-box = высота чипа → флекс-центрирование ставит их ТОЧНО вровень (оптический центр
     текста ≈ центр 18px-строки = центр чипа). */
  line-height: 18px;
  color: var(--ink);
  white-space: nowrap;
}
/* Маленький acid-чип со стрелкой — «откроется в Telegram». Плашка (как счётчики-бейджи 12/4/1
   в этом же меню), т.к. чистый кислотный ГЛИФ не читается на бумаге; в тёмной теме acid→синий,
   чип по-прежнему читаем. Стрелка — инлайн-SVG (юникод ↗ сидел криво в своём боксе), геометрически
   отцентрован в чипе. Флекс-сосед заголовка → вровень с текстом; ink-обводка. */
.drawer__tg-arr {
  flex: none;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  background: var(--ink);
  color: var(--bg);
  box-shadow: inset 0 0 0 1px var(--ink);
}


@media(max-width:1023px){
  .drawer__panel { width: min(88vw,360px); padding: calc(var(--safe-t) + 16px) 16px calc(var(--safe-b) + 16px); gap: 24px; border: 0; border-radius: 0 20px 20px 0; overflow-y: auto; }
  .drawer__heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
  .drawer__heading .drawer__brand { border: 0; padding: 0; background: none; }
  .drawer__brand::after { display: none; }
  .drawer__dismiss { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 12px; background: var(--vitrine); color: var(--ink); }
  .drawer__nav { gap: 6px; }
  .navitem { height: 54px; padding: 0 14px; border: 0; border-radius: 12px; font-size: 16px; gap: 14px; }
  .navitem--active { background: var(--vitrine); }
  .navitem__account-hint { margin-left: auto; color: var(--ink-dim); font: 400 12px/1.4 var(--grotesk); }
  .navitem--active::before { left: 0; height: 24px; width: 3px; border-radius: 2px; box-shadow: none; }
  .drawer__avatar { border-radius: 12px; box-shadow: none; color: var(--ink); }
  .drawer__account-cap { font: 13px/1.4 var(--grotesk); letter-spacing: 0; }
  .city-chooser { margin:0 0 18px; border:1px solid var(--line-soft); border-radius:16px; background:var(--plinth); overflow:hidden; }
  .city-chooser__trigger { display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; min-height:70px; padding:12px 14px; text-align:left; border:0; background:none; color:var(--ink); font:500 15px/1.35 var(--grotesk); }
  .city-chooser__trigger>span:first-child { min-width:0; display:grid; gap:4px; }
  .city-chooser__trigger small { font-size:12px; color:var(--ink-dim); }
  .city-chooser__trigger strong { font-size:16px; overflow-wrap:anywhere; }
  .city-chooser__action { flex:none; font-size:12px; color:var(--ink-dim); }
  .city-chooser__body { border-top:1px solid var(--line-soft); padding:12px; }
  .city-chooser__body input { width:100%; min-width:0; height:44px; padding:10px 12px; border:1px solid var(--line-soft); border-radius:10px; background:var(--bg); color:var(--ink); font:400 16px var(--grotesk); }
  .city-chooser__list { display:grid; max-height:min(280px,40dvh); overflow:auto; overscroll-behavior:contain; margin-top:8px; gap:3px; }
  .city-chooser__list button { display:flex; align-items:center; justify-content:space-between; gap:8px; width:100%; padding:10px; min-height:44px; border:0; border-radius:10px; background:none; color:var(--ink); text-align:left; font:500 14px/1.4 var(--grotesk); }
  .city-chooser__list button[aria-pressed=true] { background:var(--vitrine); font-weight:650; }
  .city-chooser__body p { margin:12px 0 0; font:400 13px/1.5 var(--grotesk); color:var(--ink-dim); }
  .drawer__panel { gap:8px; padding:calc(var(--safe-t) + 12px) 16px calc(var(--safe-b) + 12px); }
  .drawer__heading,.drawer__nav,.drawer__btm { flex:none; }
  .drawer__nav { gap:2px; }
  .drawer__nav .navitem { height:44px; min-height:44px; }
  .drawer__panel>.city-chooser { flex:none; margin:0; }
  .city-chooser--compact { border:0; border-radius:12px; background:var(--vitrine); }
  .city-chooser--compact .city-chooser__trigger { min-height:44px; padding:8px 12px; }
  .city-chooser--compact .city-chooser__trigger strong { font-size:14px; }
  .drawer__panel:has(.city-chooser__body)>.city-chooser { flex:1; min-height:0; display:flex; flex-direction:column; }
  .drawer__panel:has(.city-chooser__body) .drawer__nav,
  .drawer__panel:has(.city-chooser__body) .drawer__btm { display:none; }
  .city-chooser--compact .city-chooser__trigger { flex:none; }
  .city-chooser--compact .city-chooser__body { min-height:0; display:flex; flex-direction:column; overflow:auto; }
  .city-chooser--compact .city-chooser__body input { flex:none; }
  .city-chooser--compact .city-chooser__list { max-height:none; min-height:0; }

}
@media(max-width:1023px) and (max-height:640px) {
  .drawer__panel { gap:6px; padding-top:calc(var(--safe-t) + 8px); padding-bottom:calc(var(--safe-b) + 8px); }
  .drawer__tg { display:none; }
}

.drawer { --safe-t:env(safe-area-inset-top,0px); --safe-b:env(safe-area-inset-bottom,0px); --line-soft:color-mix(in srgb,var(--ink) 14%,transparent); --line:var(--ink); --fs-label:12px; --ease-snap:cubic-bezier(.2,.8,.2,1); --ink-faint:var(--ink-dim); }
.drawer,.drawer * { box-sizing:border-box; }
.drawer button { margin:0; }
.drawer__panel::before { content:none; }
.drawer__panel { overscroll-behavior:contain; }
.drawer__panel > * { position:relative; z-index:1; }
.drawer__brand { display:flex; align-items:baseline; line-height:1; }
.drawer__brand .brand-o { display:inline-block; }
.drawer__panel:focus { outline:none; }
@media(prefers-reduced-motion:reduce){.drawer,.drawer__panel{transition:none}}
