/* Компоненты веб-клиента поверх токенов (фаза 12).
 *
 * Цвет берётся ТОЛЬКО из tokens.css. Ни одного шестнадцатеричного значения
 * ниже нет и быть не должно: новый цвет сначала появляется в docs/themes.md,
 * потом в токенах, и только потом здесь. Иначе «фирменный бирюзовый»
 * становится тремя разными бирюзовыми в вебе, кабинете и приложении.
 *
 * Bootstrap не подключается: панели проекта его тоже не используют, а тащить
 * 200 КБ ради сетки и кнопок, которые всё равно перекрашиваются токенами,
 * незачем. Сетка здесь — grid и flex, они есть везде (Р-095).
 */

/* --- Основа ---------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;

  /* Место под полосу прокрутки резервируется ВСЕГДА. Иначе страница, у
     которой содержимое дорисовывается скриптом, в момент появления полосы
     сужается на её ширину — и весь макет дёргается вбок. Заметнее всего это
     в ленте поиска, где карточки приезжают после первой отрисовки */
  scrollbar-gutter: stable;
}

/* Плавные переходы там, где меняется состояние, и нигде больше: анимировать
   всё подряд — значит получить «кисель» вместо отзывчивости */
@media (prefers-reduced-motion: no-preference) {
  a, button, summary, .tile, .card, .chip, .tab {
    transition: background-color .15s ease, border-color .15s ease,
                color .15s ease, box-shadow .15s ease, transform .15s ease;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--brand-ink);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

h1, h2, h3, h4 {
  margin: 0 0 12px;
  line-height: 1.25;
  font-weight: 650;
}

h1 { font-size: 30px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }

p { margin: 0 0 12px; }

/* Фокус виден всегда: клавиатурная навигация — это доступность, а не
   украшение. Убирать обводку ради «чистоты» значит выключить сайт для тех,
   кто не пользуется мышью */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.wrap {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

.wrap--wide { max-width: 1440px; }

main {
  flex: 1 0 auto;
  padding: 24px 0 48px;
}

.muted { color: var(--text2); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.row { display: flex; gap: 12px; align-items: center; }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; }
.mt { margin-top: 16px; }
.mt-lg { margin-top: 32px; }
.mb { margin-bottom: 16px; }
.hidden { display: none !important; }

/* --- Шапка ----------------------------------------------------------- */

.header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 19px;
  color: var(--text);
  text-decoration: none;
}

.logo:hover { text-decoration: none; }

.logo__mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--gradient-brand);
  flex: none;
}

.nav {
  display: flex;
  gap: 4px;
  margin-left: 8px;
}

.nav__link {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text2);
  font-weight: 500;
}

.nav__link:hover {
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.nav__link--active {
  color: var(--text);
  background: var(--surface3);
}

.header__right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface3);
  object-fit: cover;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  flex: none;
}

.badge-count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--error);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: inline-grid;
  place-items: center;
}

/* --- Кнопки ---------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--surface3);
  color: var(--text);
  font: inherit;
  font-weight: 550;
  cursor: pointer;
  text-decoration: none;
  transition: filter .15s ease, background .15s ease;
}

.btn:hover { text-decoration: none; filter: brightness(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn--brand {
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow-brand);
}

.btn--ghost {
  background: transparent;
  border-color: var(--border2);
  color: var(--text);
}

.btn--quiet {
  background: transparent;
  color: var(--text2);
  padding: 8px 10px;
}

.btn--danger { background: var(--error); color: #fff; }
.btn--sm { padding: 6px 12px; font-size: 13px; }
.btn--block { width: 100%; }

/* --- Карточки и плашки ----------------------------------------------- */

.card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card--pad { padding: 18px; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--surface3);
  color: var(--text2);
  font-size: 13px;
  white-space: nowrap;
}

.chip--brand { background: var(--brand-bg); color: var(--brand-ink); }

.tone {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.tone--success { background: var(--success-bg); color: var(--success-ink); }
.tone--warning { background: var(--warning-bg); color: var(--warning-ink); }
.tone--error   { background: var(--error-bg);   color: var(--error-ink); }
.tone--info    { background: var(--info-bg);    color: var(--info-ink); }
.tone--muted   { background: var(--surface3);   color: var(--text2); }

.notice {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  margin-bottom: 16px;
}

.notice--error   { background: var(--error-bg);   border-color: transparent; color: var(--error-ink); }
.notice--success { background: var(--success-bg); border-color: transparent; color: var(--success-ink); }
.notice--info    { background: var(--info-bg);    border-color: transparent; color: var(--info-ink); }

/* --- Формы ----------------------------------------------------------- */

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label { font-size: 13px; color: var(--text2); font-weight: 500; }

.input,
.select,
.textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border2);
  background: var(--surface2);
  color: var(--text);
  font: inherit;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--brand);
  outline: none;
}

.textarea { min-height: 96px; resize: vertical; }

.form-narrow {
  max-width: 420px;
  margin: 32px auto;
}

/* --- Витрина --------------------------------------------------------- */

.hero {
  padding: 44px 0 32px;
  background: var(--gradient-brand);
  color: #fff;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  margin-bottom: 28px;
}

.hero h1 { color: #fff; font-size: 34px; }
.hero p { color: rgba(255, 255, 255, .88); max-width: 620px; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; }

.tab {
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--surface3);
  color: var(--text2);
  font-weight: 550;
}

.tab:hover { text-decoration: none; }
.tab--active { background: var(--brand); color: #fff; }

.hero .tab { background: rgba(255, 255, 255, .18); color: #fff; }
.hero .tab--active { background: #fff; color: var(--brand-ink); }

.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.tile { position: relative; }

.tile__photo {
  aspect-ratio: 4 / 3;
  width: 100%;
  object-fit: cover;
  background: var(--surface3);
}

.tile__body { padding: 12px 14px 14px; }
.tile__title { font-weight: 600; margin: 0 0 4px; font-size: 15px; }
.tile__meta { color: var(--text2); font-size: 13px; margin-bottom: 8px; }
.tile__price { font-weight: 650; }

.tile__fav {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--overlay);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 16px;
}

.tile__fav[aria-pressed="true"] { background: var(--error); }

.rating { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.rating__star { color: var(--gold); }

/* --- Поиск ----------------------------------------------------------- */

.search-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.search-layout--map {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 18px;
}

.filters .field { margin: 0; min-width: 130px; }

/* Карта карточки объекта. Своим классом, а не по `#map`: общее правило с
   `min-height: 420px` и `position: sticky` растягивало её на карточке и
   уводило вверх — она вылезала поверх текста и выглядела чужой на странице */
.map-box {
  height: 320px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 12px;
}

/* Карта целым экраном (W25) */
.map-page {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.map-page__canvas {
  height: calc(100vh - 260px);
  min-height: 420px;
}

.map-page__note {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  max-width: min(420px, calc(100% - 32px));
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1px solid var(--border2);
  box-shadow: var(--shadow-md);
  font-size: 13px;
  color: var(--text2);
  text-align: center;
}

/* Метка — ценник, а не булавка: на карте выбирают по цене и месту сразу, и
   карта из одинаковых булавок заставляет открывать каждую ради главного */
.map-pin {
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  line-height: 1;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--border2);
  background: var(--surface2);
  color: var(--text);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  white-space: nowrap;
}

.map-pin:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  transform: translateY(-1px);
}

.map-card {
  display: block;
  width: 210px;
  color: var(--text);
}

.map-card:hover { text-decoration: none; }

.map-card__photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--surface3);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.map-card__body { padding: 8px 10px 10px; }

.map-card__title {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.map-card__price { color: var(--brand-ink); font-weight: 650; margin-top: 4px; }

.maplibregl-popup-content {
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  box-shadow: var(--shadow-lg);
}

.filters--compact { padding: 10px 12px; }

/* --- Карточка объекта ------------------------------------------------ */

/* Галерея подстраивается под ЧИСЛО снимков. Сетка «2fr 1fr 1fr в два ряда»
   красива ровно на пяти фотографиях; на двух она оставляет три пустые ячейки,
   и карточка выглядит недогруженной, а не лаконичной */
.gallery {
  display: grid;
  gap: 6px;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
  max-height: 460px;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
  background: var(--surface3);
}

.gallery--1 { grid-template-columns: 1fr; grid-template-rows: 1fr; aspect-ratio: 16 / 7; }
.gallery--2 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; aspect-ratio: 16 / 7; }
.gallery--3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 16 / 8; }
.gallery--4 { grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; }

.gallery--3 img:first-child,
.gallery--4 img:first-child,
.gallery--5 img:first-child { grid-row: span 2; }

.gallery--4 img:nth-child(2) { grid-column: span 2; }

.listing-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 32px;
  align-items: start;
}

.booking-box {
  position: sticky;
  top: 84px;
  padding: 20px;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  background: var(--surface2);
  box-shadow: var(--shadow-md);
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.fact { padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.fact__label { font-size: 12px; color: var(--text3); }
.fact__value { font-weight: 600; }

.amenities {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
}

.review { padding: 16px 0; border-top: 1px solid var(--border); }
.review__head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.review__reply {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--brand);
}

/* --- Чат ------------------------------------------------------------- */

.chat-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.dialog-list { display: flex; flex-direction: column; }

.dialog-item {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.dialog-item:hover { background: var(--surface); text-decoration: none; }
.dialog-item--active { background: var(--surface3); }

.messages {
  height: 60vh;
  min-height: 380px;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
}

.bubble {
  max-width: 72%;
  padding: 9px 13px;
  border-radius: var(--radius);
  background: var(--surface2);
  border: 1px solid var(--border);
  align-self: flex-start;
  word-break: break-word;
}

.bubble--mine {
  align-self: flex-end;
  background: var(--brand-bg);
  border-color: transparent;
}

.bubble--system {
  align-self: center;
  background: transparent;
  border: none;
  color: var(--text3);
  font-size: 13px;
}

.bubble__time { font-size: 11px; color: var(--text3); margin-top: 3px; }

.bubble__mask {
  font-size: 12px;
  color: var(--warning-ink);
  margin-top: 4px;
}

.composer {
  display: flex;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
}

/* --- Подвал ---------------------------------------------------------- */

.footer {
  flex: none;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 28px 0;
  color: var(--text2);
  font-size: 14px;
}

.footer__cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
  margin-bottom: 20px;
}

.footer a { color: var(--text2); display: block; padding: 3px 0; }
.footer a:hover { color: var(--text); }

/* --- Адаптив: от 360 px ---------------------------------------------- */

@media (max-width: 980px) {
  .listing-layout,
  .chat-layout,
  .search-layout--map { grid-template-columns: 1fr; }
  .booking-box { position: static; }
  .map-page__canvas { height: 60vh; }
  .gallery { grid-template-columns: 1fr 1fr; max-height: none; }
  .gallery img:first-child { grid-column: span 2; }
}

@media (max-width: 640px) {
  .wrap { padding: 0 14px; }
  h1 { font-size: 24px; }
  .hero { padding: 28px 0 22px; }
  .hero h1 { font-size: 26px; }
  .nav { display: none; }
  .header__inner { height: 56px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .bubble { max-width: 88%; }
}

/* Печать: человек уносит с собой бронь, а не интерфейс */
@media print {
  .header, .footer, .booking-box, .btn { display: none !important; }
}

/* Хлебные крошки и сетка направлений (W25, W26).
   Крошки переносятся: «Таиланд › Пхукет › Патонг» на узком экране обязано
   переноситься, а не уезжать за край страницы. */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.crumbs a { color: var(--text2); }
.crumbs a:hover { color: var(--brand); }

.place-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

/* Кнопка записи голосового (W08).
   Во время записи она красная и пульсирует: без явного признака человек не
   понимает, идёт запись или он промахнулся мимо кнопки, и говорит в тишину. */
.composer__record { font-size: 15px; line-height: 1; }

.composer__record--on {
  color: var(--error);
  animation: bnt-pulse 1.1s ease-in-out infinite;
}

@keyframes bnt-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

/* --- Шапка: значки, выпадающие меню, кнопка профиля ------------------ */

/* Кнопка-значок с рамкой. До этого переключатель темы был голым символом и
   в шапке его попросту не было видно — люди не догадывались, что он там */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 36px;
  min-width: 36px;
  padding: 0 10px;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  color: var(--text2);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.icon-btn:hover { background: var(--surface3); color: var(--text); text-decoration: none; }
.icon-btn::-webkit-details-marker { display: none; }
.icon-btn--wide { min-width: 56px; }

.menu__caret { font-size: 9px; opacity: .6; }

/* Меню на <details>: оно открывается и без скрипта. Список, который не
   открывается при сбое JavaScript, — единственный способ сменить язык на
   странице, где скрипт не загрузился */
.menu { position: relative; }

.menu[open] > .icon-btn { background: var(--surface3); color: var(--text); }

.menu__body {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 50;
  min-width: 210px;
  padding: 6px;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  background: var(--surface2);
  box-shadow: var(--shadow-lg);
}

.menu__title {
  padding: 6px 10px 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text3);
}

.menu__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.menu__item:hover { background: var(--surface3); text-decoration: none; }
.menu__item--active { background: var(--brand-bg); color: var(--brand-ink); font-weight: 600; }
.menu__code { font-size: 12px; color: var(--text3); }

.menu__note {
  padding: 8px 10px 4px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text3);
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px 0 4px;
  border: 1px solid var(--border2);
  border-radius: 999px;
  background: var(--surface2);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
}

.profile-btn:hover { background: var(--surface3); text-decoration: none; }
.profile-btn .avatar { width: 28px; height: 28px; font-size: 13px; }

.profile-btn__name {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- Профиль: сводка вместо списка ссылок ---------------------------- */

.profile-head {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--gradient-brand);
  color: #fff;
  margin-bottom: 22px;
}

.profile-head .avatar {
  width: 64px;
  height: 64px;
  font-size: 24px;
  background: rgba(255, 255, 255, .22);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, .5);
}

.profile-head h1 { color: #fff; margin: 0; font-size: 26px; }
.profile-head .muted { color: rgba(255, 255, 255, .82); }

.stats {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-bottom: 22px;
}

.stat {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
}

.stat:hover { border-color: var(--border2); box-shadow: var(--shadow-sm); text-decoration: none; }
.stat__value { font-size: 24px; font-weight: 700; line-height: 1.1; color: var(--text); }
.stat__label { font-size: 13px; color: var(--text3); margin-top: 4px; }

.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}

.upcoming {
  display: grid;
  gap: 12px;
}

/* Ближайшая поездка — крупной строкой с фотографией: на экране профиля это
   единственное, что человек действительно ищет глазами */
.upcoming__item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
  color: var(--text);
}

.upcoming__item:hover { border-color: var(--brand); text-decoration: none; }

.upcoming__photo {
  width: 96px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--surface3);
}

.side-menu { display: grid; gap: 6px; }

.side-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  color: var(--text);
  font-weight: 500;
}

.side-menu a:hover { border-color: var(--brand); background: var(--surface); text-decoration: none; }
.side-menu__badge {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

@media (max-width: 900px) {
  .profile-layout { grid-template-columns: 1fr; }
  .profile-btn__name { display: none; }
  .profile-btn { padding: 0 4px; }
}

/* Группы разделов профиля */
.side-group { margin-bottom: 18px; }

.side-group__title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text3);
  margin: 0 0 8px 2px;
}

.side-menu__hint {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--text3);
  margin-top: 2px;
}

.side-menu--active {
  border-color: var(--brand) !important;
  background: var(--brand-bg) !important;
}
