/* ============================================================
   Fear Protection — оформление v2
   Новый верхний бар, вертикальные разделы, проверка в две
   колонки, история чатов, тикеты и кастомизация.
   ============================================================ */

/* Цвет текста на акцентной кнопке: site-custom.js подбирает его
   по яркости выбранного акцента, чтобы надпись всегда читалась. */
:root {
  --on-accent: #fff;
}

.btn-accent {
  color: var(--on-accent, #fff);
}

/* Кнопки в модалках одной высоты, чтобы не «прыгали». */
.modal-actions .btn,
.confirm-actions .btn {
  min-height: 36px;
}

/* ---------- Фон сайта (кастомизация) ---------- */
.site-bg {
  display: none;
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: var(--bg);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
body {
  background-color: var(--bg);
}

/* ---------- Верхний бар v2 ---------- */
.topbar-v2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}
.topbar-v2 > * {
  min-width: 0;
}
.topbar-profile {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 5px 12px 5px 5px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: default;
}
.topbar-profile .topbar-ava {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  overflow: hidden;
  flex: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--panel-3);
}
.topbar-profile .topbar-ava img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.topbar-profile .topbar-user-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.topbar-profile .topbar-nick {
  font-size: 13.5px;
  font-weight: 700;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-profile .topbar-sid {
  font-size: 10.5px;
  color: var(--text-faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.topbar-right {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Переключатель проекта */
.project-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}
.project-switch:hover {
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(255, 255, 255, 0.09);
}
.project-switch-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  line-height: 1.1;
}
.project-switch-text h1 {
  margin: 0;
  font-size: 16px;
}
.project-switch-text span {
  font-size: 10.5px;
  color: var(--text-faint);
  font-weight: 500;
}
.project-switch-caret {
  width: 16px;
  height: 16px;
  color: var(--text-faint);
  flex: none;
  transition: transform 0.16s ease;
}
.project-switch[aria-expanded="true"] .project-switch-caret {
  transform: rotate(180deg);
}

/* Полноэкранное окно смены проекта «Кто играет?» */
.project-switch-wrap {
  position: relative;
  justify-self: center;
  min-width: 0;
}

.switch-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  background:
    radial-gradient(900px 620px at 50% -12%, rgba(var(--accent-rgb), 0.2), transparent 62%),
    radial-gradient(720px 520px at 84% 112%, rgba(133, 160, 255, 0.1), transparent 60%),
    rgba(4, 5, 9, 0.95);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  animation: switch-fade 0.18s ease both;
}
.switch-overlay[hidden] {
  display: none;
}
body.switch-open {
  overflow: hidden;
}
@keyframes switch-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.switch-inner {
  width: 100%;
  max-width: 1000px;
  text-align: center;
  animation: switch-rise 0.26s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
@keyframes switch-rise {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.switch-title {
  margin: 0;
  font-size: clamp(40px, 6.4vw, 78px);
  line-height: 0.96;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 22px 70px rgba(0, 0, 0, 0.65);
}
.switch-sub {
  margin: 18px 0 0;
  font-size: 15px;
  color: rgba(238, 241, 247, 0.58);
}

.switch-accounts {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(22px, 4vw, 56px);
  margin-top: clamp(42px, 7vh, 78px);
}
.switch-account {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 172px;
  padding: 0;
  border: 0;
  background: none;
  color: rgba(238, 241, 247, 0.7);
  text-decoration: none;
  font: inherit;
  cursor: pointer;
  outline: none;
}
.switch-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(112px, 13vw, 150px);
  height: clamp(112px, 13vw, 150px);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #1b1e29, #0c0e15 70%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.switch-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.switch-account[href="/yooma"] .switch-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.switch-account.is-current .switch-avatar {
  border-color: rgba(var(--accent-rgb), 0.65);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.4), 0 0 54px rgba(var(--accent-rgb), 0.42),
    inset 0 0 46px rgba(var(--accent-rgb), 0.16);
}
.switch-account.is-selected .switch-avatar {
  transform: translateY(-5px) scale(1.035);
  border-color: rgba(var(--accent-rgb), 0.9);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.16), 0 0 68px rgba(var(--accent-rgb), 0.62),
    inset 0 0 52px rgba(var(--accent-rgb), 0.22);
}
.switch-account.is-selected .switch-name {
  color: #fff;
}
.switch-name {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  max-width: 100%;
  text-align: center;
  overflow-wrap: anywhere;
  transition: color 0.16s ease;
}
.switch-badge {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 11px;
  border-radius: 999px;
  background: linear-gradient(180deg, #6d7dff, #4d5ae6);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(77, 90, 230, 0.5);
}


.switch-hints {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: clamp(40px, 7vh, 72px);
  font-size: 12px;
  color: rgba(238, 241, 247, 0.4);
}
.switch-hints span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.switch-hints kbd {
  min-width: 24px;
  padding: 4px 7px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(238, 241, 247, 0.78);
  font: 600 11px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: center;
}

.switch-close {
  position: fixed;
  top: 22px;
  right: 24px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}
.switch-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  transform: rotate(90deg);
}
.switch-close svg {
  width: 20px;
  height: 20px;
}

.topbar-admin {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
.topbar-admin:hover {
  color: var(--text);
  background: rgba(var(--accent-rgb), 0.14);
  border-color: rgba(var(--accent-rgb), 0.45);
}
.topbar-admin svg {
  width: 18px;
  height: 18px;
}

/* Модалка выбора проекта */
.project-modal {
  width: min(780px, 100%);
}
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.project-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-2);
  color: var(--text);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.project-card:hover {
  transform: translateY(-1px);
  border-color: rgba(var(--accent-rgb), 0.5);
  background: var(--panel-3);
}
.project-card.is-current {
  border-color: rgba(var(--accent-rgb), 0.55);
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.16), rgba(var(--accent-rgb), 0.04));
}
.project-ico {
  width: 46px;
  height: 46px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 13px;
  border: 1px solid var(--border-2);
  background: var(--panel-3);
  color: var(--accent-2);
}
.project-ico img {
  width: 27px;
  height: 27px;
  object-fit: contain;
}
.project-ico svg {
  width: 22px;
  height: 22px;
}
.project-ico.yooma {
  color: #ffcf5a;
}
.project-ico.tops {
  color: #ffb26b;
}
.project-ico.track {
  color: #64d6ff;
}
.project-ico.admin {
  color: #c9a7ff;
}
.project-card-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}
.project-card-text b {
  font-size: 14px;
}
.project-card-text em {
  font-size: 11.5px;
  color: var(--text-dim);
  font-style: normal;
}
.project-check {
  color: var(--accent-2);
  font-weight: 700;
  flex: none;
}

/* Счётчик цели банов справа */
.goal-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}
.goal-chip:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(var(--accent-rgb), 0.4);
}
.goal-chip-ico {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: none;
  color: var(--green);
  background: rgba(63, 199, 122, 0.12);
  border: 1px solid rgba(63, 199, 122, 0.32);
}
.goal-chip-ico svg {
  width: 17px;
  height: 17px;
}
.goal-chip-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 128px;
}
.goal-chip-nums {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: 12px;
  color: var(--text-dim);
}
.goal-chip-nums b {
  font-size: 14px;
  color: var(--text);
}
.goal-chip-nums em {
  font-style: normal;
  font-size: 10.5px;
  color: var(--text-faint);
  margin-left: 2px;
}
.goal-chip-bar {
  display: block;
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.goal-chip-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--green), var(--accent-2));
  transition: width 0.3s ease;
}
.goal-panel-modal {
  border: 0;
  background: transparent;
  padding: 0;
}

/* ---------- Панель: вертикальные разделы ---------- */
.app-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  padding-bottom: 104px;
  align-items: start;
  position: relative;
  z-index: 1;
}
.app-nav {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(16, 16, 20, 0.72), var(--panel));
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}
.app-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.app-nav-item:hover {
  color: var(--text);
  background: var(--panel-2);
}
.app-nav-item.is-active {
  color: #fff;
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.24), rgba(var(--accent-rgb), 0.08));
  border-color: rgba(var(--accent-rgb), 0.45);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}
.app-nav-ico {
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  color: currentColor;
}
.app-nav-ico svg {
  width: 16px;
  height: 16px;
}
.app-nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.app-panes {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.app-panes .psearch {
  margin: 0;
}
.pane {
  display: none;
}
.pane.is-active {
  display: block;
  animation: fade-in 0.18s ease both;
}
.pane .feed-section {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 218px);
  min-height: 430px;
  max-height: 860px;
  margin: 0;
}
.pane .section-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  flex: 1 1 auto;
  min-height: 0;
  scrollbar-gutter: stable;
}

/* Одна вкладка «Нарушения»: новореги, нарушения и другие проекты стопкой */
.pane-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.pane-stack .feed-section {
  height: auto;
  min-height: 0;
  max-height: none;
}
.pane-stack .feed-section .section-body {
  max-height: 38vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.rules-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.rule-card {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-2);
}
.rule-card h3 {
  margin: 0 0 6px;
  font-size: 14px;
}
.rule-card p {
  margin: 0;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.55;
}

/* ---------- История чатов ---------- */
.chat-history-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.feed-search-input {
  flex: 1;
  min-width: 0;
  padding: 10px 13px;
  border-radius: 11px;
  border: 1px solid var(--border-2);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: none;
}
.feed-search-input:focus {
  border-color: var(--accent);
}
.chat-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.history-card {
  cursor: pointer;
}

/* ---------- Проверка игрока: две колонки ---------- */
.modal-check {
  width: min(1080px, 100%);
}
.check-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
  gap: 16px;
  align-items: start;
}
.check-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.check-col-title {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-faint);
  font-weight: 700;
}
.check-col-violations {
  padding-left: 16px;
  border-left: 1px solid var(--border);
}
.check-foot {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* ---------- Тикеты ---------- */
.tickets-fab {
  position: fixed;
  right: 18px;
  bottom: 22px;
  left: auto;
  z-index: 70;
  height: 48px;
  min-width: 48px;
  padding: 0 18px 0 15px;
  border-radius: 99px;
  border: 1px solid rgba(var(--accent-rgb), 0.55);
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
}
.tickets-fab::after {
  content: "Тикеты";
}
.tickets-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 46px rgba(var(--accent-rgb), 0.4);
}
.tickets-fab svg {
  width: 20px;
  height: 20px;
  flex: none;
}
.tickets-fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 99px;
  background: #ff5d5d;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
  border: 2px solid var(--bg);
}
.tickets-modal {
  width: min(1000px, 100%);
  height: min(82vh, 780px);
  max-height: min(82vh, 780px);
}
.tickets-modal-body {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}
.tickets-app {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  width: 100%;
  height: 100%;
  min-height: 0;
  background: var(--panel);
}
.tickets-inline .tickets-app {
  height: min(68vh, 700px);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.tickets-side {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: rgba(0, 0, 0, 0.16);
}
.tickets-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px;
}
.tickets-side-title {
  font-weight: 700;
  font-size: 14px;
}
.tickets-list {
  overflow-y: auto;
  padding: 0 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
  min-height: 0;
}
.tickets-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font: inherit;
}
.tickets-item:hover {
  background: var(--panel-2);
}
.tickets-item.is-active {
  background: rgba(var(--accent-rgb), 0.14);
  border-color: rgba(var(--accent-rgb), 0.35);
}
.tickets-item.is-closed {
  opacity: 0.65;
}
.tickets-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  background: var(--panel-3);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--accent-2);
  font-size: 14px;
}
.tickets-avatar.sm {
  width: 34px;
  height: 34px;
  font-size: 13px;
}
.tickets-item-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.tickets-item-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.tickets-item-top b {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tickets-item-time {
  font-size: 10.5px;
  color: var(--text-faint);
  flex: none;
}
.tickets-item-last {
  font-size: 11.5px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tickets-item-unread {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--accent);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex: none;
}
.tickets-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}
.tickets-empty {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
  color: var(--text-dim);
}
.tickets-empty-ico {
  font-size: 30px;
}
.tickets-empty h4 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
}
.tickets-empty p {
  margin: 0;
  max-width: 360px;
  font-size: 13px;
  line-height: 1.5;
}
.tickets-empty.small {
  font-size: 12px;
  padding: 14px;
}
.tickets-thread-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.tickets-thread-who {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.tickets-thread-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.tickets-thread-info b {
  font-size: 14px;
}
.tickets-thread-info span {
  font-size: 11.5px;
  color: var(--text-dim);
}
.tickets-thread-actions {
  display: flex;
  gap: 6px;
  flex: none;
}
.tickets-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tickets-msg {
  display: flex;
  justify-content: flex-start;
}
.tickets-msg.owner {
  justify-content: flex-end;
}
.tickets-bubble {
  max-width: 78%;
  padding: 10px 12px;
  border-radius: 14px 14px 14px 4px;
  background: var(--panel-3);
  border: 1px solid var(--border);
}
.tickets-msg.owner .tickets-bubble {
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.28), rgba(var(--accent-rgb), 0.12));
  border-color: rgba(var(--accent-rgb), 0.4);
  border-radius: 14px 14px 4px 14px;
}
.tickets-msg-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
  line-height: 1.45;
}
.tickets-msg-meta {
  margin-top: 5px;
  font-size: 10.5px;
  color: var(--text-faint);
}
.tickets-reply {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  align-items: flex-end;
}
.tickets-textarea,
.tickets-input {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  resize: vertical;
  outline: none;
}
.tickets-textarea:focus,
.tickets-input:focus {
  border-color: var(--accent);
}
.tickets-reply .tickets-textarea {
  flex: 1;
  min-height: 44px;
  max-height: 140px;
}
.tickets-compose {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}
.tickets-compose-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.tickets-closed-note {
  padding: 8px 16px;
  font-size: 11.5px;
  color: #e8b866;
  background: rgba(232, 184, 102, 0.08);
}
.tickets-loading {
  padding: 24px;
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--text-dim);
}
.admin-tab-badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 5px;
  border-radius: 99px;
  background: var(--accent);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  vertical-align: middle;
}

/* ---------- Админка: оформление ---------- */
.design-panel {
  padding: 16px;
}
.design-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.design-group {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--panel-2);
}
.design-group h4 {
  margin: 0;
  font-size: 14px;
}
.design-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.design-mode {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}
.design-mode input {
  accent-color: var(--accent);
}
.design-mode:has(input:checked) {
  border-color: rgba(var(--accent-rgb), 0.5);
  color: var(--text);
  background: rgba(var(--accent-rgb), 0.12);
}
.design-field {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-dim);
}
.design-field span {
  flex: 1;
}
.design-field input[type="color"] {
  width: 44px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--border-2);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}
.design-field input[type="range"] {
  width: 120px;
  accent-color: var(--accent);
}
.design-field em {
  font-style: normal;
  font-size: 11px;
  color: var(--text-faint);
  min-width: 36px;
  text-align: right;
}
.design-upload {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.design-upload input[type="file"] {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--text-dim);
}
.design-upload input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 7px 12px;
  border-radius: 9px;
  border: 1px solid var(--border-2);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.design-upload input[type="file"]::file-selector-button:hover {
  background: rgba(var(--accent-rgb), 0.18);
  border-color: rgba(var(--accent-rgb), 0.5);
}
.design-upload-note {
  font-size: 11px;
  color: var(--text-faint);
}
.design-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.design-hint {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-dim);
}
.design-bg-preview {
  margin-top: 2px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #05060a;
}
.design-bg-preview img {
  display: block;
  width: 100%;
  height: 128px;
  object-fit: cover;
}
.design-page {
  max-width: 1040px;
  padding-bottom: 30px;
}
.design-page .design-panel + .design-panel {
  margin-top: 16px;
}
.design-users-panel {
  margin-top: 16px;
}
.design-users {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 12px;
}
.design-users-empty {
  grid-column: 1 / -1;
  padding: 28px 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-faint);
  border: 1px dashed var(--border);
  border-radius: 12px;
}
.design-user {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-2);
  overflow: hidden;
}
.design-user-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}
.design-user-ava {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(var(--accent-rgb), 0.18);
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}
.design-user-ava img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.design-user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.design-user-info b {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.design-user-info em {
  font-style: normal;
  font-size: 11px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.design-user-reset {
  flex: none;
}
.design-user-body {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
}
.design-user-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  width: 72px;
  flex: none;
}
.design-user-swatches i {
  width: 15px;
  height: 15px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.design-user-bg {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.design-user-bg-preview {
  flex: none;
  width: 46px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background-color: #0a0c12;
  background-size: cover;
  background-position: center;
}
.design-user-bg-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.design-user-bg-text b {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.design-user-bg-text em {
  font-style: normal;
  font-size: 10.5px;
  color: var(--text-faint);
}
.admin-tab-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

/* ---------- Мессенджер владельца ---------- */
.messenger-topbar {
  margin-bottom: 6px;
}
.messenger-back {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.messenger-back:hover {
  background: rgba(var(--accent-rgb), 0.1);
  border-color: rgba(var(--accent-rgb), 0.4);
  color: var(--text);
}
.messenger-back svg {
  width: 17px;
  height: 17px;
}
.messenger-topbar-right {
  justify-self: end;
  min-width: 0;
}
.messenger-stats {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.messenger-page {
  max-width: 1240px;
  padding-bottom: 24px;
}
.messenger-shell {
  height: calc(100vh - 158px);
  min-height: 520px;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--panel);
  box-shadow: 0 24px 60px -34px rgba(0, 0, 0, 0.9);
}
.messenger-shell .tickets-app {
  height: 100%;
}

/* ---------- Адаптив ---------- */
@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 200px minmax(0, 1fr);
  }
  .tickets-app {
    grid-template-columns: 250px minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .check-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .check-col-violations {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--border);
    padding-top: 14px;
  }
  .design-grid,
  .project-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .topbar-v2 {
    grid-template-columns: auto 1fr auto;
    gap: 6px;
    padding: 0 10px;
  }
  .project-switch-text span,
  .project-switch-caret,
  .topbar-profile .topbar-sid {
    display: none;
  }
  .project-switch-text h1 {
    font-size: 14px;
  }
  .topbar-profile .topbar-nick {
    max-width: 92px;
    font-size: 12px;
  }
  .topbar-profile .topbar-ava {
    width: 34px;
    height: 34px;
  }
  .goal-chip {
    padding: 5px 8px;
    gap: 7px;
  }
  .goal-chip-body {
    min-width: 74px;
  }
  .goal-chip-nums em {
    display: none;
  }
  .app-shell {
    display: block;
    padding: 12px;
    padding-bottom: 96px;
  }
  .app-nav {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    padding: 6px;
    margin-bottom: 12px;
    border-radius: 14px;
    scrollbar-width: none;
  }
  .app-nav::-webkit-scrollbar {
    display: none;
  }
  .app-nav-item {
    flex: none;
    width: auto;
    white-space: nowrap;
    padding: 8px 10px;
    font-size: 12.5px;
  }
  .app-nav-ico {
    width: 24px;
    height: 24px;
  }
  .pane .feed-section {
    height: auto;
    min-height: 420px;
    max-height: none;
  }
  .tickets-modal {
    height: min(90vh, 780px);
  }
  .tickets-app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }
  .tickets-side {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    max-height: 210px;
  }
  .tickets-list {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .tickets-item {
    width: 210px;
    flex: none;
  }
  .tickets-fab {
    right: 12px;
    left: auto;
    bottom: 86px;
    height: 46px;
    padding: 0 15px 0 13px;
  }
  .messenger-shell {
    height: auto;
    min-height: 0;
  }
  .messenger-shell .tickets-app {
    height: min(78vh, 720px);
  }
  .messenger-back span {
    display: none;
  }
  .messenger-back {
    padding: 8px 10px;
  }
  .messenger-stats {
    font-size: 11px;
  }
}

@media (max-width: 760px) {
  .switch-overlay {
    padding: 60px 16px 32px;
    align-items: flex-start;
    overflow-y: auto;
  }
  .switch-title {
    font-size: clamp(32px, 11vw, 48px);
    letter-spacing: 0.1em;
  }
  .switch-sub {
    margin-top: 12px;
    font-size: 13px;
  }
  .switch-accounts {
    gap: 26px;
    margin-top: 34px;
  }
  .switch-account {
    width: 132px;
    gap: 12px;
  }
  .switch-avatar {
    width: 104px;
    height: 104px;
  }
  .switch-hints {
    gap: 12px 18px;
    margin-top: 34px;
    font-size: 11px;
  }
  .switch-close {
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
  }
  .design-users {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ============================================================
   Мобильное управление: крупные кнопки, полноэкранные модалки,
   одна колонка карточек и нижняя навигация с подписями.
   ============================================================ */
@media (max-width: 760px) {
  html {
    -webkit-text-size-adjust: 100%;
  }
  body {
    overflow-x: hidden;
  }

  .layout {
    padding: 10px;
    padding-bottom: 104px;
    gap: 12px;
  }
  .main.feeds-col {
    gap: 10px;
  }
  .feeds-col .feed-section,
  .pane .feed-section {
    max-height: none;
    min-height: 0;
  }

  /* Панель /app: разделы — крупные табы сверху, без горизонтальной прокрутки */
  .app-shell {
    display: block;
    padding: 10px;
    padding-bottom: 104px;
  }
  .app-nav {
    position: sticky;
    top: 56px;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    padding: 5px;
    margin-bottom: 10px;
    overflow: visible;
    border-radius: 16px;
    background: rgba(16, 16, 20, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .app-nav-item {
    position: relative;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    width: auto;
    min-height: 52px;
    padding: 6px 2px;
    font-size: 10px;
    line-height: 1.15;
    text-align: center;
    white-space: normal;
  }
  .app-nav-item > span:not(.app-nav-ico):not(.app-nav-badge) {
    display: block;
    max-width: 100%;
    overflow-wrap: anywhere;
  }
  .app-nav-ico {
    width: 26px;
    height: 26px;
  }
  .app-nav-badge {
    position: absolute;
    top: 3px;
    right: 3px;
    margin: 0;
    min-width: 17px;
    height: 17px;
    font-size: 10px;
  }

  /* На телефоне список раздела прокручивается страницей, а не внутри карточки */
  .pane-stack .feed-section .section-body {
    max-height: none;
    overflow: visible;
  }
  .pane-stack .feed-section {
    min-height: 0;
  }

  .chat-history-toolbar {
    flex-wrap: wrap;
    gap: 6px;
  }
  .chat-history-toolbar .feed-search-input {
    flex: 1 1 100%;
  }
  .feeds-col .section-body,
  .pane .section-body {
    overflow: visible;
    scrollbar-gutter: auto;
  }
  .feed-section {
    margin-bottom: 0;
  }

  .section-head {
    padding: 11px 12px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .section-title {
    font-size: 14px;
    gap: 8px;
  }
  .section-head > .btn {
    min-height: 38px;
  }
  .section-body {
    padding: 10px;
  }

  .cards,
  .yooma-page .feeds-col > .feed-section .cards {
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
  }
  .reg-card {
    padding: 11px;
    gap: 10px;
  }
  .reg-card .rc-avatar {
    width: 46px;
    height: 46px;
    border-radius: 10px;
  }
  .rc-head {
    flex-wrap: wrap;
  }
  .rc-actions {
    gap: 6px;
  }
  /* Две кнопки в ряд, а не столбиком: карточки вдвое короче */
  .rc-actions .btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    min-height: 38px;
    padding-left: 8px;
    padding-right: 8px;
    font-size: 12.5px;
  }
  .section-body > .feed-search {
    position: static;
  }

  .psearch {
    padding: 4px;
    gap: 4px;
  }
  .psearch-input {
    height: 38px;
    font-size: 16px;
    padding: 0 6px;
  }
  .psearch-btn {
    height: 38px;
    padding: 0 12px;
    font-size: 13px;
  }
  input,
  select,
  textarea {
    font-size: 16px;
  }

  /* Модалки — на весь экран, чтобы ничего не обрезалось */
  .modal-backdrop {
    padding: 0;
    align-items: stretch;
  }
  .modal,
  .modal-sm,
  .modal-lg,
  .modal-check {
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: 0;
  }
  .modal-head {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 12px;
    background: rgba(16, 16, 20, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .modal-body {
    padding: 12px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }
  .modal-actions,
  .confirm-actions {
    padding: 10px 12px;
  }
  .modal-close {
    width: 42px;
    height: 42px;
    font-size: 17px;
  }
  .modal-avatar {
    width: 46px;
    height: 46px;
    border-radius: 11px;
  }
  .modal-title h3 {
    font-size: 16px;
  }

  /* Нижняя навигация: крупные кнопки с подписями */
  .dock {
    left: 8px;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    transform: none;
    animation: none;
    width: auto;
    max-width: none;
    padding: 6px;
    gap: 2px;
    border-radius: 18px;
    justify-content: space-between;
  }
  .dock::before {
    display: none;
  }
  .dock-btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 50px;
    padding: 5px 2px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-radius: 12px;
  }
  .dock-btn svg {
    width: 20px;
    height: 20px;
  }
  .dock-btn > span:not(.theme-switch) {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 9.5px;
    line-height: 1.15;
  }
  .dock-sep {
    display: none;
  }
  .dock-btn.dock-danger {
    flex: 0 0 48px;
  }
  .dock-btn.dock-danger > span {
    display: none;
  }

  .topbar {
    height: 56px;
    padding: 0 8px;
  }
  .topbar-profile {
    padding: 3px 6px 3px 3px;
    gap: 7px;
  }
  .topbar-nick {
    max-width: 86px;
  }

  .tickets-fab {
    bottom: calc(72px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 430px) {
  .layout {
    padding: 8px;
    padding-bottom: 100px;
  }
  .topbar .brand h1 {
    display: none;
  }
  .project-switch-text h1 {
    font-size: 13px;
  }
  .goal-chip {
    display: none;
  }
  .admincheck-item > .btn {
    width: 100%;
  }
}

/* ============================================================
   Разовый опрос при входе + результаты в /admin
   ============================================================ */
.survey-modal {
  width: min(460px, 100%);
}
.survey-form {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.survey-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.survey-option {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-2);
  cursor: pointer;
  font-size: 14px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.survey-option:hover {
  border-color: var(--border-2);
}
.survey-option input {
  width: 18px;
  height: 18px;
  flex: none;
  margin: 0;
  accent-color: var(--accent);
}
.survey-option:has(input:checked) {
  border-color: rgba(var(--accent-rgb), 0.6);
  background: rgba(var(--accent-rgb), 0.12);
}
.survey-error {
  margin-top: 10px;
  color: #ed4245;
  font-size: 12.5px;
}
.survey-submit {
  min-width: 140px;
}

.survey-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.survey-results-title {
  font-size: 16px;
  font-weight: 700;
}
.survey-results-sub {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--text-dim);
}
.survey-stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}
.survey-stat {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(16, 16, 20, 0.5), var(--panel));
}
.survey-stat-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.survey-stat-label {
  font-size: 13.5px;
  font-weight: 600;
}
.survey-stat-num {
  font-size: 12.5px;
  color: var(--text-dim);
  white-space: nowrap;
}
.survey-stat-track {
  height: 8px;
  border-radius: 99px;
  background: var(--panel-2);
  overflow: hidden;
}
.survey-stat-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.survey-responses {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.survey-response {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
}
.survey-response-ava {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  font-weight: 700;
}
.survey-response-ava img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.survey-response-info {
  flex: 1;
  min-width: 0;
}
.survey-response-name {
  font-weight: 600;
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.survey-response-meta {
  font-size: 11px;
  color: var(--text-faint);
  overflow-wrap: anywhere;
}
.survey-response-answer {
  flex: none;
  padding: 5px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  color: #cfe0ff;
  background: rgba(var(--accent-rgb), 0.16);
  border: 1px solid rgba(var(--accent-rgb), 0.4);
}
.survey-empty {
  padding: 24px 12px;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
}

/* Док прячется при прокрутке вниз, чтобы освободить экран */
.dock {
  transition: transform 0.22s ease, opacity 0.22s ease;
}
@media (max-width: 760px) {
  .dock.dock-hidden {
    transform: translateY(calc(100% + 24px)) !important;
    opacity: 0;
    pointer-events: none;
  }

  /* Опрос на телефоне — компактная карточка по центру, а не на весь экран */
  .survey-backdrop {
    align-items: center;
    padding: 8px;
  }
  .survey-modal {
    width: 100%;
    height: auto;
    max-height: calc(100dvh - 16px);
    border: 1px solid var(--border-2);
    border-radius: 18px;
  }
  .survey-option {
    padding: 14px;
    font-size: 15px;
  }
  .survey-submit {
    width: 100%;
    min-height: 44px;
  }
  .survey-response {
    flex-wrap: wrap;
  }
  .survey-response-answer {
    margin-left: 49px;
  }
}



/* ---------- Опрос: пожелания к сайту ---------- */
.survey-wish {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 16px;
}
.survey-wish-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}
.survey-wish-input {
  min-height: 78px;
  max-height: 180px;
}

/* ---------- Тикеты: заявки, статусы, меню закрытия ---------- */
.tickets-app.is-user {
  grid-template-columns: minmax(0, 1fr);
}
.tickets-app.is-user .tickets-side {
  display: none;
}
.tickets-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 14px 10px;
}
.tickets-filter {
  padding: 5px 10px;
  border-radius: 99px;
  border: 1px solid var(--border-2);
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
}
.tickets-filter:hover {
  color: var(--text);
  border-color: rgba(var(--accent-rgb), 0.4);
}
.tickets-filter.is-active {
  background: rgba(var(--accent-rgb), 0.16);
  border-color: rgba(var(--accent-rgb), 0.5);
  color: var(--text);
}
.tickets-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}
.tickets-pill.is-open {
  color: #7fd4a0;
  background: rgba(76, 197, 124, 0.12);
  border-color: rgba(76, 197, 124, 0.3);
}
.tickets-pill.is-accepted {
  color: #e8b866;
  background: rgba(232, 184, 102, 0.12);
  border-color: rgba(232, 184, 102, 0.3);
}
.tickets-pill.is-closed {
  color: var(--text-faint);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-2);
}
.tickets-pill.is-cat {
  color: var(--accent-2);
  background: rgba(var(--accent-rgb), 0.1);
  border-color: rgba(var(--accent-rgb), 0.28);
}
.tickets-thread-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tickets-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.tickets-item-cat {
  font-size: 10.5px;
  color: var(--text-dim);
}
.tickets-field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
}
.tickets-cats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.tickets-cat-option {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border-2);
  background: var(--panel-2);
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.tickets-cat-option:hover {
  border-color: rgba(var(--accent-rgb), 0.4);
}
.tickets-cat-option.is-active {
  border-color: rgba(var(--accent-rgb), 0.6);
  background: rgba(var(--accent-rgb), 0.12);
}
.tickets-cat-option b {
  font-size: 13px;
}
.tickets-cat-option span {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.4;
}
.tickets-hint {
  font-size: 11.5px;
  color: #e8b866;
  line-height: 1.45;
}
.tickets-select {
  max-width: 230px;
  background: var(--panel-2);
  border: 1px solid var(--border-2);
  border-radius: 9px;
  color: var(--text);
  padding: 7px 9px;
  font: inherit;
  font-size: 12px;
  outline: none;
}
.tickets-close-wrap {
  position: relative;
}
.tickets-close-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  min-width: 190px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  background: var(--panel-2);
  border: 1px solid var(--border-2);
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
}
.tickets-close-item {
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.tickets-close-item:hover {
  background: rgba(var(--accent-rgb), 0.14);
}
.tickets-msg.bot {
  justify-content: center;
}
.tickets-bot {
  max-width: 86%;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(var(--accent-rgb), 0.08);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  text-align: center;
}
.tickets-bot .tickets-msg-meta {
  text-align: center;
}
.tickets-bot .tickets-msg-text {
  font-size: 12.5px;
}

@media (max-width: 640px) {
  .tickets-cats {
    grid-template-columns: 1fr;
  }
  .tickets-thread-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .tickets-thread-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .tickets-select {
    max-width: 100%;
    flex: 1 1 100%;
  }
  .tickets-close-menu {
    right: auto;
    left: 0;
  }
}


/* ---------- Админка: пожелания из опроса ---------- */
.survey-wishes-head {
  margin: 22px 0 10px;
}
.survey-wishes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.survey-wish-item {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-2);
}
.survey-wish-who {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.survey-wish-text {
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  padding-left: 46px;
}

/* ---------- Отдельный вопросник «Пожелания» ---------- */
.wishes-modal {
  width: min(520px, calc(100vw - 32px));
}
.wishes-modal .modal-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wishes-input {
  width: 100%;
  min-height: 110px;
  max-height: 220px;
}
@media (max-width: 640px) {
  .wishes-modal {
    width: 100%;
    height: auto;
    max-height: calc(100dvh - 16px);
    border: 1px solid var(--border-2);
    border-radius: 18px;
  }
  .wishes-modal .survey-submit {
    width: 100%;
    min-height: 44px;
  }
}

/* ---------- Плашка-напоминание про мут ---------- */
.fp-plate {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 14px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 190, 92, 0.34);
  border-radius: 13px;
  background:
    linear-gradient(180deg, rgba(255, 190, 92, 0.12), rgba(255, 190, 92, 0.06)),
    rgba(20, 16, 10, 0.55);
  color: #ffd89a;
  font-size: 13px;
  line-height: 1.5;
}

.fp-plate-ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 50%;
  background: rgba(255, 190, 92, 0.2);
  color: #ffcf7a;
  font-size: 12px;
  font-weight: 800;
}

.fp-plate-text {
  min-width: 0;
}

/* Продолжение сообщений одного игрока: имя показываем только один раз. */
.chat-who-empty {
  flex: 1;
  min-width: 0;
}
.chat-bubble.chat-cont {
  padding-top: 7px;
}

/* ---------- Оформление: зимняя тема ---------- */
.design-season-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.design-season-actions .btn {
  min-width: 170px;
}

/* ---------- Текст внутри карточек ---------- */
/* Длинные ники, адреса серверов и причины не должны вылезать за карточки. */
.reg-card,
.viol-card,
.tr-card,
.about-card,
.about-project,
.design-user,
.la-account,
.stats-admin,
.ticket-card {
  overflow-wrap: anywhere;
}

.reg-card .rc-meta,
.viol-card .rc-meta,
.tr-card .tr-meta,
.tr-card .tr-body,
.tr-card .tr-top,
.stats-admin-info,
.about-project-body,
.la-info {
  min-width: 0;
}

/* Длинные подписи в модалках переносятся, а не растягивают окно. */
.modal-actions,
.confirm-actions {
  align-items: center;
}
.modal-actions .btn,
.confirm-actions .btn {
  max-width: 100%;
  white-space: normal;
  text-align: center;
}



/* ---------- Доступ: уровни (зам владельца / помощник / пользователь) ---------- */
.access-hint {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px dashed var(--border);
  background: rgba(255, 255, 255, 0.02);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-faint);
}

.access-tag.level-deputy {
  background: rgba(255, 193, 7, 0.13);
  color: #ffd35c;
  border-color: rgba(255, 193, 7, 0.35);
}

.access-tag.level-assistant {
  background: rgba(63, 199, 122, 0.13);
  color: var(--green);
  border-color: rgba(63, 199, 122, 0.35);
}

.access-tag.level-user {
  background: rgba(143, 183, 255, 0.12);
  color: #a9c4ff;
  border-color: rgba(143, 183, 255, 0.35);
}

.access-level-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.access-level-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-faint);
}

.access-level-select {
  height: 30px;
  min-width: 150px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.access-level-select:hover {
  border-color: rgba(var(--accent-rgb), 0.45);
}

.access-level-select:focus {
  outline: none;
  border-color: rgba(var(--accent-rgb), 0.65);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.18);
}

html.fp-winter .access-level-select {
  background-color: rgba(9, 23, 35, 0.86);
  border-color: rgba(150, 215, 255, 0.24);
  color: #e9f8ff;
}

html.fp-winter .access-hint {
  border-color: rgba(150, 215, 255, 0.24);
  background: rgba(190, 235, 255, 0.04);
  color: #a9c4d8;
}
