/* Кабинет резидента. Основа — общие стили панели (кнопки, поля, окна, шрифты),
   здесь только раскладка кабинета: колонка под телефон и нижнее меню. */

body.lk {
  background: var(--bg);
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
body.lk-guest { padding-bottom: 0; background: #000; }

/* ---------------------------------------------------------------- шапка --- */
.lk-top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: calc(10px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  background: #000; color: #fff;
}
.lk-brand { display: flex; align-items: center; gap: 10px; color: #fff; flex: 0 0 auto; }
.lk-brand svg { width: 36px; height: 36px; display: block; }
.lk-brand span {
  font-family: var(--head); font-size: 11px; line-height: 1.15; text-transform: uppercase; letter-spacing: .02em;
}
.lk-top-title {
  margin-left: auto; font-family: var(--head); font-size: 13px; text-transform: uppercase;
  letter-spacing: .03em; color: rgba(255,255,255,.7); text-align: right;
}

.lk-main {
  max-width: 680px; margin: 0 auto;
  padding: 16px max(14px, env(safe-area-inset-left)) 20px;
  display: flex; flex-direction: column; gap: 12px;
}

/* --------------------------------------------------------- нижнее меню --- */
.lk-tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(255,255,255,.96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 6px max(8px, env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom));
}
.lk-tabs a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 4px; color: var(--muted); font-size: 10.5px; font-weight: 600;
  border-radius: 12px; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.lk-tabs a svg { width: 23px; height: 23px; }
.lk-tabs a.on { color: var(--blue); }
@media (min-width: 720px) {
  .lk-tabs { left: 50%; right: auto; transform: translateX(-50%); width: 520px;
    bottom: 14px; border: 1px solid var(--line); border-radius: 18px;
    box-shadow: 0 10px 30px rgba(0,0,0,.1); padding-bottom: 6px; }
  body.lk { padding-bottom: 100px; }
}

/* -------------------------------------------------------------- карточки --- */
.lk-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 18px;
  padding: 16px; min-width: 0;
}
.lk-card-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.lk-card-head h2 { font-size: 14px; text-transform: uppercase; flex: 1; }
.lk-card-head a { font-size: 12.5px; font-weight: 600; }
.lk-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); font-weight: 600;
}
.lk-role { color: var(--muted); font-size: 13px; margin-top: 3px; }

.lk-ava { background-color: var(--ink); color: #fff; font-family: var(--head); }

/* главная: карточка резидента */
.lk-hero {
  background: #000; color: #fff; border-radius: 22px; padding: 20px;
  position: relative; overflow: hidden;
}
.lk-hero::after {
  content: ""; position: absolute; right: -70px; top: -70px; width: 220px; height: 220px;
  border-radius: 50%; background: radial-gradient(circle, rgba(4,99,253,.55), rgba(4,99,253,0) 70%);
  pointer-events: none;
}
.lk-hero-top { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.lk-hero .lk-ava { border: 2px solid rgba(255,255,255,.18); }
.lk-hero-text { min-width: 0; }
.lk-hello { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.55); font-weight: 600; }
.lk-hero h1 { font-size: 21px; line-height: 1.15; margin-top: 3px; text-transform: uppercase; word-break: break-word; }
.lk-hero .lk-role { color: rgba(255,255,255,.7); }

/* главная: клубная карта */
.lk-pass { display: flex; gap: 16px; align-items: center; }
.lk-pass-qr {
  flex: 0 0 128px; width: 128px; height: 128px; padding: 6px; border-radius: 14px;
  border: 1px solid var(--line); background: #fff;
}
.lk-pass-qr svg { width: 100%; height: 100%; display: block; }
.lk-pass-text { min-width: 0; }
.lk-pass-code { font-family: var(--head); font-size: 19px; letter-spacing: .08em; margin: 4px 0 6px; }
.lk-pass-text p { margin: 0 0 10px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }

/* главная: взнос */

.lk-link { display: block; color: var(--ink); background: var(--blue-soft); border-color: #D4E2FF; }
.lk-link span { display: block; font-weight: 700; color: var(--blue); }
.lk-link small { display: block; margin-top: 3px; color: #4A6FAE; font-size: 12px; line-height: 1.45; }

/* ------------------------------------------------------------- события --- */
.lk-date {
  flex: 0 0 48px; width: 48px; height: 52px; border-radius: 12px;
  background: var(--blue-soft); color: var(--blue);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.lk-date b { font-size: 18px; line-height: 1; font-weight: 700; }
.lk-date span { font-size: 10px; text-transform: uppercase; margin-top: 3px; font-weight: 600; }

.lk-ev-row {
  display: flex; gap: 12px; align-items: center; width: 100%; text-align: left;
  background: none; border: 0; padding: 10px 0; cursor: pointer;
  border-bottom: 1px solid #F0F0EC; touch-action: manipulation;
}
.lk-ev-row:last-child { border-bottom: 0; }
.lk-ev-text { min-width: 0; }
.lk-ev-title { font-weight: 700; font-size: 14px; line-height: 1.3; }
.lk-ev-meta {
  display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12.5px; margin-top: 4px;
}
.lk-ev-meta svg { width: 14px; height: 14px; flex: 0 0 14px; }

.lk-month {
  font-family: var(--head); text-transform: uppercase; font-size: 13px; letter-spacing: .03em;
  margin: 8px 4px -2px; color: var(--muted);
}
.lk-events { display: grid; gap: 12px; }
@media (min-width: 560px) { .lk-events { grid-template-columns: 1fr 1fr; } }
.lk-ev {
  display: flex; align-items: stretch; text-align: left; padding: 0; cursor: pointer;
  background: var(--paper); border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
  touch-action: manipulation; color: var(--ink); min-height: 132px;
}
.lk-ev-poster {
  flex: 0 0 106px; width: 106px; aspect-ratio: 4 / 5; align-self: center;
  background: #111 center / cover no-repeat;
  display: flex; align-items: center; justify-content: center;
}
.lk-ev-poster > span { font-family: var(--head); font-size: 34px; color: rgba(255,255,255,.25); }
.lk-ev-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.lk-ev-when {
  color: var(--blue); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
}
.lk-ev-body .lk-ev-title {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.lk-ev-body .badge { align-self: flex-start; margin-top: 6px; }

.lk-event-view h2 { font-size: 18px; line-height: 1.25; text-transform: uppercase; margin: 14px 0 10px; }
.lk-ev-big { width: 100%; border-radius: 14px; display: block; }
.lk-ev-facts { display: grid; gap: 6px; margin-bottom: 12px; }
.lk-ev-facts div { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.lk-ev-facts svg { width: 17px; height: 17px; color: var(--blue); flex: 0 0 17px; }
.lk-ev-desc { line-height: 1.6; white-space: pre-wrap; margin: 14px 0 0; }
.lk-ev-note { color: var(--muted); font-size: 12.5px; margin: 14px 0 0; }

/* ----------------------------------------------------------- резиденты --- */
.lk-search { position: relative; }
.lk-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.lk-search .input { height: 48px; padding-left: 42px; border-radius: 14px; font-size: 15px; }

.lk-chips {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin: 0 -14px; padding: 0 14px 2px; -webkit-overflow-scrolling: touch;
}
.lk-chips::-webkit-scrollbar { display: none; }
/* на широком экране ниши видны все сразу, без прокрутки вбок */
@media (min-width: 720px) { .lk-chips { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; } }
.lk-chips button {
  flex: 0 0 auto; border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  padding: 8px 13px; border-radius: 99px; font-size: 13px; font-weight: 600; cursor: pointer;
  white-space: nowrap; touch-action: manipulation;
}
.lk-chips button b { color: var(--muted); font-weight: 600; margin-left: 2px; }
.lk-chips button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.lk-chips button.on b { color: rgba(255,255,255,.6); }
.lk-count { color: var(--muted); font-size: 12.5px; margin: -2px 4px; }
.lk-count:empty { display: none; }

.lk-people { display: grid; gap: 8px; }
@media (min-width: 560px) { .lk-people { grid-template-columns: 1fr 1fr; } }
.lk-person {
  display: flex; gap: 12px; align-items: center; text-align: left; width: 100%;
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px;
  padding: 12px; cursor: pointer; color: var(--ink); touch-action: manipulation;
}
.lk-person-text { min-width: 0; flex: 1; }
.lk-person-name { font-weight: 700; font-size: 14px; line-height: 1.25; }
.lk-person-cat { color: var(--blue); font-size: 11.5px; font-weight: 600; margin-top: 2px; }
.lk-person-niche {
  color: var(--muted); font-size: 12.5px; line-height: 1.4; margin-top: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.lk-pv-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; margin-bottom: 16px; }
.lk-pv-head h2 { font-size: 19px; text-transform: uppercase; margin-top: 8px; line-height: 1.2; }
.lk-pv-head .badge { margin-top: 4px; }
.lk-pv-niche { line-height: 1.6; margin: 6px 0 16px; white-space: pre-wrap; }
.lk-contacts { display: grid; gap: 8px; }
.lk-contacts .btn { height: 46px; justify-content: center; gap: 8px; }
.lk-contacts .btn svg { width: 18px; height: 18px; }

/* ------------------------------------------------------------- профиль --- */
.lk-photo { display: flex; align-items: center; gap: 16px; }
.lk-photo-img {
  flex: 0 0 84px; width: 84px; height: 84px; border-radius: 50%;
  background: #000 center / cover no-repeat; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--head); font-size: 26px;
}
.lk-photo-name { font-family: var(--head); text-transform: uppercase; font-size: 16px; line-height: 1.2; }
.lk-photo .btn { margin-top: 10px; gap: 6px; }
.lk-photo .btn svg { width: 16px; height: 16px; }
.lk-form .hint { margin: 12px 0 4px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.lk-form-title {
  font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  margin: 22px 0 12px; padding-top: 18px; border-top: 1px solid #F0F0EC;
}
.lk-form textarea { resize: vertical; }
.lk-save { width: 100%; height: 50px; margin-top: 18px; font-size: 15px; }

.lk-switch { display: flex; align-items: center; gap: 12px; cursor: pointer; margin: 4px 0 2px; }
.lk-switch input { position: absolute; opacity: 0; pointer-events: none; }
.lk-switch-ui {
  flex: 0 0 44px; width: 44px; height: 26px; border-radius: 99px; background: #D6D6D0;
  position: relative; transition: background .18s;
}
.lk-switch-ui::after {
  content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .18s;
}
.lk-switch input:checked + .lk-switch-ui { background: var(--blue); }
.lk-switch input:checked + .lk-switch-ui::after { transform: translateX(18px); }
.lk-switch input:focus-visible + .lk-switch-ui { box-shadow: 0 0 0 3px rgba(4,99,253,.25); }
.lk-switch b { display: block; font-size: 13.5px; }
.lk-switch small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }

.lk-logout {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  background: none; border: 0; color: var(--red); font-weight: 600; padding: 14px; cursor: pointer;
}
.lk-logout svg { width: 18px; height: 18px; }

/* ---------------------------------------------------------- экран входа --- */
.lk-login {
  min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  padding: 24px 18px;
  background: radial-gradient(120% 70% at 50% 0%, #0A2A66 0%, #000 60%);
}
.lk-login-card {
  width: 100%; max-width: 380px; background: #fff; border-radius: 26px;
  padding: 32px 24px; text-align: center;
}
.lk-login-logo svg { width: 88px; height: 88px; margin: 0 auto; display: block; }
.lk-login-card h1 { font-size: 20px; text-transform: uppercase; margin-top: 18px; }
.lk-login-club { color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: 11.5px; margin: 6px 0 18px; }
.lk-login-card p { line-height: 1.6; color: #444; margin: 0 0 14px; }
.lk-login-card .btn { width: 100%; height: 48px; justify-content: center; }

/* страница «ссылка не работает» — отдаётся сервером без приложения */
body.lk-notice {
  margin: 0; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 18px;
  font-family: 'Montserrat', Arial, sans-serif; background: radial-gradient(120% 70% at 50% 0%, #0A2A66 0%, #000 60%);
}
.lk-notice-card { max-width: 380px; width: 100%; background: #fff; border-radius: 26px; padding: 32px 24px; text-align: center; }
.lk-notice-logo { width: 84px; height: 84px; }
.lk-notice-card h1 { font-size: 20px; margin: 16px 0 10px; text-transform: uppercase; }
.lk-notice-card p { line-height: 1.6; color: #444; margin: 0; }

/* окна кабинета — снизу, как листы в приложении */
@media (max-width: 560px) {
  body.lk .overlay { align-items: flex-end; padding: 0; }
  body.lk .modal { border-radius: 22px 22px 0 0; max-height: calc(100vh - 40px); }
}

/* -------------------------------------------------------------- Telegram --- */
.lk-home-btn, .lk-tg-link {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  cursor: pointer; color: var(--ink); touch-action: manipulation;
}
.lk-home-btn svg, .lk-tg-link svg { width: 26px; height: 26px; flex: 0 0 26px; color: var(--blue); }
.lk-home-btn b, .lk-tg-link b { display: block; font-size: 14px; }
.lk-home-btn small, .lk-tg-link small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; line-height: 1.4; }
.lk-tg-link { background: #EAF4FC; border-color: #D2E7F8; }
.lk-tg-link svg { color: #2AABEE; }

.lk-big-qr { text-align: center; }
.lk-big-qr svg { width: min(300px, 78vw); height: auto; display: block; margin: 0 auto; }
.lk-big-qr .lk-pass-code { margin-top: 14px; }
.lk-big-qr p { color: var(--muted); margin: 6px 0 0; }

.lk-tg-note { text-align: center; color: var(--muted); font-size: 12.5px; margin: 6px 0 0; }
.lk-login-small { font-size: 12.5px; color: var(--muted) !important; }

/* внутри Telegram шапку и отступы безопасной зоны задаёт сам мессенджер */
body.lk-tg .lk-top { padding-top: 10px; }

/* взнос: сумма, состояние и одна крупная кнопка */
.lk-fee { display: block; }
.lk-fee.due { border-color: #F0E4CC; background: #FFFCF5; }
.lk-fee-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.lk-fee-period { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: lowercase; }
.lk-fee-sum { font-family: var(--head); font-size: 30px; line-height: 1.05; margin: 8px 0 2px; }
.lk-fee-state { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 17px; margin: 8px 0 2px; }
.lk-fee-state svg { width: 19px; height: 19px; }
.lk-fee-state.green { color: var(--green); }
.lk-fee-state.amber { color: var(--amber); }
.lk-fee-last { color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.lk-fee-warn {
  display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; padding: 10px 12px;
  border-radius: 12px; background: var(--red-soft); color: #8E2630; font-size: 12px; line-height: 1.45;
}
.lk-fee-warn svg { width: 17px; height: 17px; flex: 0 0 auto; margin-top: 1px; }
.lk-fee-btn {
  width: 100%; height: 50px; margin-top: 14px; font-size: 15px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.lk-fee-btn small { font-size: 12.5px; font-weight: 600; opacity: .8; }
/* оплата по счёту — второстепенный путь: та же кнопка, но контуром */
.lk-fee-btn2 { height: 46px; margin-top: 8px; font-size: 14px; border: 1px solid var(--ink); }
.lk-fee-btn2:hover { background: var(--bg); }
.lk-fee-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.lk-fee-links button {
  border: 0; background: none; padding: 0; font: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--blue); cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}
.lk-stale {
  order: 0; background: var(--amber-soft); color: #7A5600; border-radius: 12px;
  padding: 10px 12px; font-size: 12.5px; line-height: 1.45;
}
.lk-stale button { border: 0; background: none; color: var(--blue); font: inherit;
  font-weight: 700; cursor: pointer; padding: 0; margin-left: 4px; }

.lk-pv-role {
  display: inline-block; margin: 2px 0 4px; padding: 3px 10px; border-radius: 999px;
  background: var(--bg); color: var(--muted); font-size: 11px; font-weight: 700;
}
.lk-pv-role.council { background: var(--blue-soft); color: var(--blue); }
.lk-pv-role.elder { background: var(--amber-soft); color: var(--amber); }
.lk-fee-test { margin-top: 10px; color: var(--muted); font-size: 11px; line-height: 1.45; }

/* карта отключена за неоплаченный взнос */
.lk-pass.off .lk-pass-qr { filter: blur(6px) grayscale(1); opacity: .55; pointer-events: none; }
.lk-big-qr.off svg { filter: blur(9px) grayscale(1); opacity: .5; }
.lk-big-qr-off { margin-top: 10px; color: #8E2630; font-size: 12.5px; font-weight: 600; line-height: 1.45; }
.lk-pass.off .lk-pass-text p { color: #8E2630; }

/* окно оплаты: сумма, месяцы, автосписание */
.lk-pay-form { display: flex; flex-direction: column; gap: 12px; }
.lk-pay-sum { font-family: var(--head); font-size: 32px; line-height: 1.05; }
.lk-pay-for { color: var(--muted); font-size: 13px; margin-top: -8px; }
.lk-pay-check {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line);
  border-radius: 12px; cursor: pointer;
}
.lk-pay-check input { width: 20px; height: 20px; margin: 1px 0 0; flex: 0 0 auto; }
.lk-pay-check span { font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.lk-pay-check small { display: block; margin-top: 3px; font-weight: 500; color: var(--muted); font-size: 11.5px; }
.lk-pay-note { margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.5; }
/* ссылки на документы в окне оплаты и сами документы */
.lk-pay-docs { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: -4px; }
.lk-pay-docs button {
  border: 0; background: none; padding: 0; font: inherit; font-size: 11.5px; color: var(--blue);
  cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}
.lk-doc h2 { font-size: 13.5px; margin: 16px 0 6px; }
.lk-doc p { margin: 0 0 9px; font-size: 13.5px; line-height: 1.6; }
.lk-doc li { font-size: 13.5px; line-height: 1.6; margin-bottom: 5px; }
/* из чего складывается сумма: взнос и разовый штраф при возвращении */
.lk-pay-split { margin-top: -4px; border-top: 1px solid var(--line); }
.lk-pay-split div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0;
  border-bottom: 1px solid var(--line); font-size: 13px; }
.lk-pay-split span { color: var(--muted); }

/* расписание: ближайшие / прошедшие */
.lk-when { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
.lk-when button { justify-content: center; }
.lk-when b { margin-left: 4px; color: var(--muted); font-weight: 600; }
.lk-ev.past .lk-ev-poster { filter: grayscale(.55); opacity: .85; }
.lk-ev.past .lk-ev-when { color: var(--muted); }
.lk-ev-body .badge svg { width: 12px; height: 12px; margin-right: 3px; vertical-align: -1px; }

/* --------------------------------------------------- мероприятие сегодня --- */
.lk-today {
  display: flex; flex-direction: column; gap: 4px; width: 100%; text-align: left; cursor: pointer;
  border: 0; border-radius: 18px; padding: 16px 18px; color: #fff; touch-action: manipulation;
  background: linear-gradient(135deg, #0463FD 0%, #0348C0 100%);
  box-shadow: 0 10px 28px rgba(4,99,253,.28);
}
.lk-today-tag {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  background: rgba(255,255,255,.18); padding: 4px 10px; border-radius: 99px;
}
.lk-today-tag::before, .lk-today-badge::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor;
  animation: lk-pulse 1.6s ease-in-out infinite;
}
@keyframes lk-pulse { 50% { opacity: .35; } }
.lk-today-title { font-family: var(--head); font-size: 17px; line-height: 1.25; text-transform: uppercase; margin-top: 6px; }
.lk-today-hint { font-size: 12.5px; color: rgba(255,255,255,.8); line-height: 1.45; }

.lk-today-badge {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px;
  color: var(--blue); background: var(--blue-soft); border-radius: 99px; padding: 3px 9px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 3px;
}
.lk-ev.today { border: 2px solid var(--blue); box-shadow: 0 8px 22px rgba(4,99,253,.14); }
.lk-ev-row.today .lk-date { background: var(--blue); color: #fff; }
.lk-today-modal { margin-top: 14px; }
.lk-event-view .lk-today-modal + h2 { margin-top: 8px; }

.lk-login-card [data-share-phone] { margin-top: 4px; }
.lk-share-status { min-height: 20px; margin: 10px 0 4px; font-size: 13px; color: var(--amber); line-height: 1.5; }

/* соцсети в карточке резидента */
.lk-socials { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.lk-social {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 13px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink); font-weight: 600; font-size: 13px;
}
.lk-social svg { width: 18px; height: 18px; flex: 0 0 18px; }
.lk-social.social-vk svg { color: #0077FF; }
.lk-social.social-tg_channel svg { color: #2AABEE; }
.lk-social.social-instagram svg { color: #D6249F; }

/* ---------------------------------------------------------------- подвал --- */
.lk-footer {
  max-width: 680px; margin: 4px auto 0; padding: 8px 16px 18px;
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
}
.lk-support {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 99px;
  background: var(--paper); border: 1px solid var(--line); color: var(--ink); font-size: 13px;
}
.lk-support svg { width: 17px; height: 17px; color: #2AABEE; flex: 0 0 17px; }
.lk-support b { font-weight: 700; }
.lk-made { color: var(--muted); font-size: 12px; }
.lk-made b { font-weight: 600; color: var(--ink); }

/* на тёмных экранах входа */
.lk-login { flex-direction: column; gap: 14px; }
.lk-login .lk-footer { margin: 0; padding-bottom: 0; }
.lk-login .lk-support { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.14); color: #fff; }
.lk-login .lk-made, .lk-login .lk-made b { color: rgba(255,255,255,.55); }

/* ======================================================================
   РАСКЛАДКА: телефон по умолчанию, широкий экран — с 1024px
   ====================================================================== */

/* --- телефон и планшет: шапка, нижнее меню, одна колонка --- */
.lk-side, .lk-page-head { display: none; }
.lk-home { display: flex; flex-direction: column; gap: 12px; }
/* колонки главной на телефоне «растворяются» — карточки идут одним списком в нужном порядке */
.lk-col-main, .lk-col-side { display: contents; }
.lk-home .lk-hero { order: 1; }
.lk-home .lk-today, .lk-home .lk-rate { order: 2; }   /* оценка — сразу за «Сегодня» */
.lk-home .lk-pass { order: 3; }
.lk-home .lk-fee { order: 4; }
.lk-home .lk-rc { order: 5; }
/* неоплаченный взнос поднимаем наверх: это то, что сейчас нужно от резидента */
.lk-home .lk-fee.due { order: 2; }
.lk-home .lk-home-events { order: 6; }
.lk-home .lk-link { order: 7; }
.lk-home .lk-home-btn, .lk-home .lk-tg-link { order: 8; }

/* --- широкий экран --- */
@media (min-width: 1024px) {
  body.lk { padding-bottom: 0; }
  .lk-top, .lk-tabs, .lk-body-footer { display: none; }

  .lk-side {
    display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: 264px; z-index: 20;
    background: #000; color: #fff; padding: 24px 16px 18px; overflow-y: auto;
  }
  .lk-side-brand { display: flex; align-items: center; gap: 12px; color: #fff; padding: 0 8px; }
  .lk-side-brand svg { width: 44px; height: 44px; flex: 0 0 44px; }
  .lk-side-brand span { font-family: var(--head); font-size: 13px; line-height: 1.15; text-transform: uppercase; }
  .lk-side-caption {
    margin: 10px 8px 22px; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
    color: rgba(255,255,255,.45); font-weight: 600;
  }
  .lk-side-nav { display: flex; flex-direction: column; gap: 4px; }
  .lk-side-nav a {
    display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px;
    color: rgba(255,255,255,.72); font-weight: 600; font-size: 14px; transition: background .15s, color .15s;
  }
  .lk-side-nav a svg { width: 20px; height: 20px; flex: 0 0 20px; }
  .lk-side-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
  .lk-side-nav a.on { background: var(--blue); color: #fff; }

  .lk-side-me {
    margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px;
    border-radius: 14px; background: rgba(255,255,255,.06); color: #fff;
  }
  .lk-side-me:hover { background: rgba(255,255,255,.1); }
  .lk-side-me span { min-width: 0; }
  .lk-side-me b { display: block; font-size: 13px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .lk-side-me small { display: block; font-size: 11.5px; color: rgba(255,255,255,.5); margin-top: 2px; }
  .lk-side-me .avatar { border: 1.5px solid rgba(255,255,255,.2); }

  .lk-side .lk-footer { padding: 14px 0 0; margin: 0; gap: 8px; }
  .lk-side .lk-support { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); color: #fff; font-size: 12.5px; }
  .lk-side .lk-made, .lk-side .lk-made b { color: rgba(255,255,255,.45); }

  .lk-body { margin-left: 264px; min-height: 100vh; }
  .lk-page-head { display: block; max-width: 1180px; margin: 0 auto; padding: 34px 40px 6px; }
  .lk-page-head h1 { font-size: 26px; text-transform: uppercase; line-height: 1.15; }
  .lk-page-sub { color: var(--muted); margin-top: 6px; font-size: 14px; }
  .lk-main { max-width: 1180px; padding: 20px 40px 48px; gap: 16px; }

  /* главная: основное слева, карта и взнос справа */
  .lk-home { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
  .lk-col-main, .lk-col-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
  .lk-col-side { position: sticky; top: 24px; }
  .lk-hero { padding: 26px 28px; }
  .lk-hero h1 { font-size: 26px; }
  .lk-pass { flex-direction: column; text-align: center; gap: 12px; padding: 22px; }
  .lk-pass-qr { flex: 0 0 auto; width: 210px; height: 210px; padding: 10px; }
  .lk-pass-text p { margin-bottom: 12px; }
  .lk-card { padding: 20px; border-radius: 20px; }

  /* резиденты — сетка карточек */
  .lk-people { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
  .lk-search .input { height: 52px; }

  /* расписание — лента афиш */
  .lk-events { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
  .lk-ev { flex-direction: column; min-height: 0; transition: transform .15s, box-shadow .15s; }
  .lk-ev:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(0,0,0,.08); }
  .lk-ev-poster { flex: 0 0 auto; width: 100%; align-self: stretch; }
  .lk-ev-body { padding: 14px 16px 16px; }
  .lk-when { max-width: 420px; }

  /* профиль — шире поля, соцсети в ряд */
  .lk-form { max-width: 900px; padding: 28px 32px; }
  .lk-social-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
  .lk-logout { max-width: 900px; }

  /* окна по центру, как на компьютере принято */
  body.lk .modal { max-width: 560px; }
}

@media (min-width: 1024px) {
  /* взнос в узкой правой колонке: статус сверху, кнопка оплаты во всю ширину */
  .lk-col-side .lk-pay { flex-direction: row; gap: 8px; min-height: 46px; }
  .lk-col-side .lk-pay small { font-size: 13px; opacity: .8; }
  .lk-col-side .lk-pay small::before { content: "·"; margin-right: 8px; }
}

/* Логотип медленно вращается — как в панели HUB (там же анимация spin, 12 секунд на оборот) */
.lk-brand svg, .lk-side-brand svg, .lk-login-logo svg, .lk-notice-logo {
  animation: spin 12s linear infinite;
}
/* тем, у кого в системе отключена анимация, логотип не крутим */
@media (prefers-reduced-motion: reduce) {
  .lk-brand svg, .lk-side-brand svg, .lk-login-logo svg, .lk-notice-logo { animation: none; }
}


/* ------------------------------------------------- «я пришёл» на мероприятие --- */
.lk-checkin-btn { width: 100%; height: 48px; margin-top: 14px; font-size: 15px; }
.lk-checkin-btn:disabled { opacity: .55; }
.lk-checkin-note { text-align: center; color: var(--muted); font-size: 12px; margin-top: 6px; }
.lk-checkin.done {
  display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px;
  padding: 13px; border-radius: 14px; background: var(--green-soft); color: var(--green); font-weight: 600;
}
.lk-checkin.done svg { width: 18px; height: 18px; flex: 0 0 18px; }


/* --------------------------------------------- мероприятие в свой календарь --- */
.lk-cal-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.lk-cal-btns .btn { justify-content: center; gap: 7px; height: 42px; font-size: 13px; text-decoration: none; }
.lk-cal-btns svg { width: 17px; height: 17px; flex: 0 0 17px; }
@media (max-width: 360px) { .lk-cal-btns { grid-template-columns: 1fr; } }


/* ------------------------------------------------------- категории в профиле --- */
.lk-cat-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.lk-cat-pick label { position: relative; cursor: pointer; }
.lk-cat-pick input { position: absolute; opacity: 0; pointer-events: none; }
.lk-cat-pick span { text-transform: none; letter-spacing: normal;
  display: inline-block; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--paper); font-size: 13px; font-weight: 600; color: var(--ink); transition: background .15s, border-color .15s;
}
.lk-cat-pick input:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; }
.lk-cat-pick input:disabled + span { opacity: .4; cursor: default; }
.lk-cat-pick input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.lk-cat-count { color: var(--muted); font-weight: 500; }
.lk-pv-cats { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }


/* ------------------------------------------------------- оценка мероприятия --- */
.lk-rate:empty { display: none; }
.lk-rate-title { font-weight: 700; font-size: 16px; line-height: 1.3; margin-top: 6px; }
.lk-rate-date { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.lk-rate-stars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 14px; }
.lk-rate-stars button {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0 8px;
  border: 1px solid #EFEFEA; border-radius: 14px; background: #FAFAF7; cursor: pointer;
  font: 600 12px/1 var(--text); color: var(--muted); transition: background .15s, border-color .15s, color .15s;
}
.lk-rate-stars svg { width: 26px; height: 26px; fill: #E2E2DC; transition: fill .15s; }
.lk-rate-stars button.on { background: #FFF6DE; border-color: #F5D98A; color: #9A6B00; }
.lk-rate-stars button.on svg { fill: #F2B31B; }
.lk-rate-note { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }


/* ---------------------------------------------------------- Random Coffee --- */
.lk-rc:empty { display: none; }
.lk-rc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.lk-rc-head > svg {
  width: 40px; height: 40px; flex: 0 0 40px; padding: 8px; border-radius: 12px;
  background: #F4ECE4; color: #8A5A2B;
}
.lk-rc-sub { font-weight: 700; font-size: 15px; margin-top: 2px; }
.lk-rc-text { margin: 0; color: #55554F; line-height: 1.55; font-size: 13.5px; }
.lk-rc-join { margin-top: 12px; }

.lk-rc-people { display: grid; gap: 8px; }
.lk-rc-person {
  display: flex; flex-direction: column; align-items: stretch; gap: 10px; padding: 10px; border-radius: 14px;
  background: #FAFAF7; border: 1px solid #EFEFEA;
}
.lk-rc-who {
  min-width: 0; display: flex; align-items: flex-start; gap: 12px; text-align: left;
  background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink);
}
.lk-rc-who span { min-width: 0; }
.lk-rc-who b { display: block; font-size: 14.5px; line-height: 1.25; }
.lk-rc-who small {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  color: var(--muted); font-size: 12.5px; line-height: 1.4; margin-top: 2px;
}
.lk-rc-contact { gap: 6px; justify-content: center; width: 100%; }
.lk-rc-contact svg { width: 16px; height: 16px; }

.lk-rc-label { font-size: 12px; font-weight: 700; margin: 14px 0 8px; }
.lk-rc-formats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lk-rc-formats button {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px;
  padding: 8px 10px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--paper);
  font-weight: 600; font-size: 13px; cursor: pointer; color: var(--ink); touch-action: manipulation;
}
.lk-rc-formats button svg { width: 18px; height: 18px; flex: 0 0 18px; }
.lk-rc-formats button.on { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
.lk-rc-note { margin-top: 10px; font-size: 12.5px; line-height: 1.5; color: var(--blue); font-weight: 600; }
.lk-rc-note.muted { color: var(--muted); font-weight: 400; }
.lk-rc-note.ok { color: var(--green); }
.lk-rc-note svg { width: 16px; height: 16px; flex: 0 0 16px; }
@media (max-width: 380px) { .lk-rc-formats { grid-template-columns: 1fr; } }

/* Ответ об участии: две кнопки в строку, активная подсвечена */
.lk-rsvp { margin-top: 14px; }
.lk-rsvp-btns { display: flex; gap: 8px; }
.lk-rsvp-btns .btn { flex: 1; justify-content: center; }
