/* ============ Поддержка: обращения ============ */
.sup { max-width: 860px; margin: 0 auto; }
.sup .section-head { margin-bottom: 8px; }
.sup a { text-decoration: none; }
a.tk-row { color: inherit; }
.sup .muted-link, #tkBack { margin-bottom: 10px; }
.sup svg, .tk svg, #tkBack svg, .tk-attach svg {
  width: 16px; height: 16px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.sup .empty__icon svg { width: 30px; height: 30px; }

/* Значок непрочитанных ответов: в меню и на кнопке меню */
.drawer__item .count { margin-left: auto; background: var(--accent); color: #fff; font-weight: 800; }
.burger { position: relative; }
.burger.has-dot::after {
  content: "";
  position: absolute; top: -3px; right: -3px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
}
.atabs .count { display: inline-grid; vertical-align: middle; margin-left: 4px; background: var(--accent); color: #fff; font-weight: 800; }
.site-footer__in a { color: var(--text); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* Статус обращения */
.tk-st {
  flex: none;
  padding: 5px 10px;
  border-radius: 9px;
  font-size: 12.5px; font-weight: 700;
  white-space: nowrap;
  background: var(--surface-2); color: var(--muted);
}
.tk-st--open { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.tk-st--answered { background: color-mix(in srgb, var(--green) 18%, transparent); color: color-mix(in srgb, var(--green) 75%, var(--text)); }
.tk-new {
  flex: none;
  padding: 5px 10px;
  border-radius: 9px;
  font-size: 12.5px; font-weight: 800;
  background: var(--accent); color: #fff;
}

/* Список обращений игрока */
.tk-list { display: flex; flex-direction: column; gap: 10px; }
.tk-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color .15s;
}
.tk-row:hover { border-color: var(--accent); }
.tk-row.is-unread { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.tk-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tk-row__main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-row__main .muted { font-size: 13px; }

/* Форма нового обращения */
.tk-form {
  display: flex; flex-direction: column; gap: 14px;
  padding: 20px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.tk-lbl { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 14px; }
.tk-lbl .inp { width: 100%; font-weight: 500; }
.tk-ta { width: 100%; height: auto; min-height: 76px; padding: 10px 12px; resize: vertical; line-height: 1.45; font-weight: 500; }
.tk-form__foot { display: flex; justify-content: flex-end; gap: 10px; }

/* Вложение */
.tk-attach .btn { display: inline-flex; align-items: center; gap: 6px; }
.tk-file { position: relative; display: inline-block; }
.tk-file img { display: block; height: 64px; max-width: 160px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.tk-file .x {
  position: absolute; top: -8px; right: -8px;
  width: 24px; height: 24px;
  border-radius: 50%;
  font-size: 16px;
  background: var(--surface); border: 1px solid var(--border);
}

/* Переписка */
.tk { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.tk--admin { grid-template-columns: minmax(0, 1fr) 280px; }
.tk__chat {
  display: flex; flex-direction: column;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}
.tk-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px; border-bottom: 1px solid var(--border); }
.tk-head__main { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 3px; }
.tk-head h2 { margin: 0; font-size: 19px; font-weight: 800; overflow-wrap: anywhere; }
.tk-head .muted { font-size: 13px; }
.tk-msgs {
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px;
  min-height: 220px; max-height: 56vh;
  overflow-y: auto;
  background: var(--bg);
}
.tk-msg {
  align-self: flex-start;
  max-width: min(78%, 560px);
  padding: 10px 13px;
  border-radius: 16px 16px 16px 4px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.tk-msg.is-mine {
  align-self: flex-end;
  border-radius: 16px 16px 4px 16px;
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}
.tk-msg__who { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; font-weight: 800; margin-bottom: 3px; }
.tk-msg.is-staff .tk-msg__who { color: var(--accent); }
.tk-msg__who span { color: var(--muted); font-weight: 500; font-size: 11.5px; }
.tk-msg__text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; font-size: 14.5px; }
.tk-msg__img { display: block; margin-top: 6px; }
.tk-msg__img img { display: block; max-width: 100%; max-height: 260px; border-radius: 10px; border: 1px solid var(--border); }
.tk-reply { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 16px; border-top: 1px solid var(--border); }
.tk-reply__foot { display: flex; align-items: center; gap: 10px; }
.tk-closed { padding: 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; text-align: center; }
.tk-closed a { color: var(--accent); font-weight: 700; }

/* Админка: карточка игрока рядом с перепиской и таблица обращений */
.tk__user {
  display: flex; flex-direction: column; gap: 9px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.tk__uname { font-size: 17px; margin-bottom: 2px; overflow-wrap: anywhere; }
.tk__user .btn { margin-top: 6px; }
.tk-tools { padding-left: 0; padding-right: 0; }
.tk-tbl tbody tr[data-tk] { cursor: pointer; }
.tk-tbl tbody tr[data-tk]:hover { background: var(--surface-2); }
.tk-tbl tr.is-unread td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.tk-tbl__subj { max-width: 340px; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 900px) {
  .tk--admin { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .tk-row { flex-wrap: wrap; }
  .tk-row__main { flex-basis: 100%; }
  .tk-msg { max-width: 90%; }
  .tk-msgs { max-height: 60vh; padding: 12px; }
  .tk-form { padding: 14px; }
  .tk-tools .seg { overflow-x: auto; max-width: 100%; }
}
