/* ==========================================================================
   BOMBALA IPTV — стили
   Шрифты (Manrope, Unbounded) подключаются через <link> в includes/header.php
   Брейкпоинты: 900px (планшет), 720px (телефон), 380px (маленький телефон)
   ========================================================================== */

:root {
  --bg: #090a0f;
  --panel: #12141d;
  --panel-2: #181b26;
  --line: #292c38;
  --muted: #9b9fad;
  --white: #f5f6fb;
  --accent: #d8ff3e;
  --vip: #b68cff;
  --danger: #fa919d;
  --gutter: clamp(16px, 4vw, 32px);
  --radius: 13px;
  --font-body: Manrope, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: Unbounded, Manrope, system-ui, Arial, sans-serif;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--white);
  font: 15px/1.5 var(--font-body);
  overflow-x: clip;
}

main { flex: 1 0 auto; width: 100%; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, p { overflow-wrap: anywhere; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

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

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px max(var(--gutter), env(safe-area-inset-right)) 10px max(var(--gutter), env(safe-area-inset-left));
  background: rgba(9, 10, 15, .92);
  border-bottom: 1px solid #1b1d27;
  -webkit-backdrop-filter: blur(15px);
  backdrop-filter: blur(15px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
  line-height: 1;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}
/* Логотип — фон из base64 (картинка подставляется в includes/header.php), без <img> и файла на сервере */
.brand-mark {
  display: block;
  width: 30px;
  height: 40px;
  background: center / contain no-repeat;
  pointer-events: none;
}
.brand-name {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font: 700 15px/1 var(--font-display);
  letter-spacing: .06em;
}
.brand-name b { color: var(--accent); font-weight: 700; font-size: 11px; letter-spacing: .32em; }

nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px 22px;
  color: #ced0d9;
  font-weight: 600;
  font-size: 14px;
}
nav > a:not(.button):hover { color: var(--white); }

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  background: var(--accent);
  color: #101109;
  border: 1px solid transparent;
  border-radius: 10px;
  font: 800 14px/1.2 var(--font-body);
  text-align: center;
  cursor: pointer;
  transition: filter .15s, transform .15s, border-color .15s;
}
.button:hover { filter: brightness(1.07); }
.button:active { transform: scale(.98); }
.button.ghost { background: transparent; border-color: #494d5a; color: var(--white); }
.button.ghost:hover { border-color: var(--accent); filter: none; }

/* ---------- Главная: hero ---------- */

h1, h2 { font-family: var(--font-display); letter-spacing: -.04em; }

.hero {
  max-width: 1210px;
  margin: 0 auto;
  padding: clamp(40px, 8vw, 80px) var(--gutter) clamp(32px, 5vw, 55px);
  min-height: min(420px, 70vh);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  overflow: hidden;
}
.hero > div:first-child { min-width: 0; }
.hero h1 { font-size: clamp(27px, 5.2vw, 44px); line-height: 1.16; margin: 10px 0 18px; }
.hero p:not(.eyebrow) { color: var(--muted); max-width: 490px; line-height: 1.7; margin: 0 0 25px; }

.eyebrow { margin: 0; font-size: 11px; letter-spacing: .14em; font-weight: 800; color: var(--accent); }

.hero-art {
  flex: 0 0 auto;
  width: clamp(240px, 30vw, 335px);
  aspect-ratio: 335 / 235;
  margin: 25px 20px 25px 0;
  background: linear-gradient(135deg, #1f2948, #332850 55%, #caff3d);
  border-radius: 23px;
  transform: rotate(-6deg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: 30px 35px 70px #0008;
}
.hero-art span { font-size: 34px; }
.hero-art strong { text-align: center; font: 700 clamp(18px, 2.4vw, 25px)/1.3 var(--font-display); }

/* ---------- Каталог ---------- */

.catalogue, section.admin { max-width: 1210px; margin: 0 auto; padding: 30px var(--gutter) 80px; }

.section-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px 20px;
  margin-bottom: 25px;
}
.section-heading h1, .section-heading h2 { margin: 6px 0 0; font-size: clamp(20px, 3.4vw, 25px); }
.section-heading > span { color: var(--muted); }

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

.card {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid #20232e;
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .2s;
}
.card:hover { border-color: #3a3f50; }

.poster { position: relative; display: block; aspect-ratio: 16 / 9; background: #222; }
.poster img { width: 100%; height: 100%; object-fit: cover; }

.badge {
  display: inline-block;
  font-size: 10px;
  line-height: 1;
  letter-spacing: .1em;
  font-weight: 800;
  padding: 6px 9px;
  border-radius: 5px;
  background: var(--accent);
  color: #12130c;
}
.badge.vip { background: var(--vip); color: #1c102e; }
.poster .badge { position: absolute; top: 11px; left: 11px; }

.card-body { display: flex; flex-direction: column; flex: 1; padding: 15px; }
.card h3 { margin: 0 0 10px; font-size: 16px; line-height: 1.3; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 13px; color: var(--muted); font-size: 13px; }
.stars { color: #ffe26a; }
.open-link {
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 13px;
  font-weight: 800;
}
.card-body .meta { margin-bottom: 17px; }
.card-body .open-link { border-top: 1px solid var(--line); }
.open-link b { color: var(--accent); }

.empty { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; color: var(--muted); }

/* ---------- Формы: вход, регистрация, админка ---------- */

.auth { max-width: 470px; margin: clamp(24px, 6vw, 55px) auto; padding: 0 var(--gutter); }
.auth:has(.wide-panel) { max-width: 720px; }

.panel, .table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(18px, 4vw, 24px);
  color: var(--white);
}
.panel { min-width: 0; }
.panel h1 { font-size: clamp(21px, 4.5vw, 25px); margin: 9px 0 23px; line-height: 1.2; }

.panel label { display: block; min-width: 0; font-weight: 700; font-size: 13px; margin: 14px 0; }
.panel label small { color: var(--muted); font-weight: 500; }

.panel input, .panel textarea, .panel select {
  display: block;
  width: 100%;
  min-width: 0;
  margin-top: 7px;
  padding: 12px;
  background: #090b11;
  border: 1px solid #363945;
  border-radius: 9px;
  color: var(--white);
  font: inherit;
  font-size: 16px; /* 16px — чтобы iOS не приближал страницу при фокусе */
  transition: border-color .15s, box-shadow .15s;
}
.panel input:focus, .panel textarea:focus, .panel select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(216, 255, 62, .15);
}
.panel textarea { min-height: 115px; resize: vertical; }

.wide { width: 100%; margin-top: 12px; }
.panel p:last-child { color: var(--muted); font-size: 13px; text-align: center; }
.panel p a, .login-gate a, .table-actions a { color: var(--accent); }
.error { padding: 10px 12px; background: #3e1d26; color: #ffadb9; border-radius: 8px; }

/* ---------- Кнопка выбора файла (везде, где есть input[type=file]) ---------- */

input[type="file"],
.panel input[type="file"] {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: #090b11;
  border: 1.5px dashed #4a4f60;
  border-radius: 12px;
  color: var(--muted);
  font: 500 14px/1.3 var(--font-body);
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
input[type="file"]:hover { border-color: var(--accent); background: #0d1119; }
input[type="file"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

input[type="file"]::file-selector-button {
  margin: 0 14px 0 0;
  min-height: 44px;
  padding: 0 20px 0 44px;
  border: 0;
  border-radius: 9px;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23101109' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V4'/%3E%3Cpath d='m7 9 5-5 5 5'/%3E%3Cpath d='M5 20h14'/%3E%3C/svg%3E") no-repeat 15px center;
  color: #101109;
  font: 800 14px/1 var(--font-body);
  cursor: pointer;
  transition: filter .15s, transform .15s;
}
input[type="file"]:hover::file-selector-button { filter: brightness(1.08); }
input[type="file"]:active::file-selector-button { transform: scale(.97); }

/* ---------- Страница плейлиста ---------- */

.detail {
  max-width: 1120px;
  margin: clamp(24px, 5vw, 55px) auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 44fr) minmax(0, 56fr);
  gap: clamp(24px, 4vw, 45px);
  align-items: start;
}
.detail-poster { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 15px; background: #222; }
.detail-info { min-width: 0; }
.detail-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.detail-info h1 { font-size: clamp(23px, 4.6vw, 32px); line-height: 1.2; margin: 14px 0 12px; }
.large { font-size: 15px; }
.description { color: #c7c9d2; line-height: 1.75; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 23px 0; }

.rating {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.rating span { margin-right: 8px; color: var(--muted); }
.star {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #515563;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: color .15s, transform .15s;
}
.star:hover, .star.chosen { color: #ffe26a; }
.star:active { transform: scale(.9); }

.login-gate {
  display: grid;
  gap: 5px;
  margin-top: 25px;
  padding: 17px 18px;
  background: var(--panel-2);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.login-gate span { color: var(--muted); }
.login-gate a { display: inline-block; font-weight: 800; margin-top: 6px; padding: 6px 0; }

/* ---------- Админка: таблица ---------- */

.table-wrap { padding: 0; overflow: auto; }
table { border-collapse: collapse; width: 100%; min-width: 650px; }
th, td { padding: 16px; text-align: left; border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }
th { color: var(--muted); font-size: 12px; }
td small { display: block; color: var(--muted); margin-top: 4px; }
.table-actions { display: flex; align-items: center; gap: 16px; }
.table-actions form { display: inline; margin: 0; }
.table-actions a, .table-actions button { padding: 8px 0; }
.table-actions button { background: none; color: var(--danger); border: 0; cursor: pointer; font: inherit; }

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

footer {
  flex-shrink: 0;
  padding: 28px max(var(--gutter), env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
  border-top: 1px solid #1b1d27;
  color: #727785;
  font-size: 13px;
}

/* ==========================================================================
   Планшет
   ========================================================================== */

@media (max-width: 900px) {
  .detail { grid-template-columns: minmax(0, 1fr); max-width: 720px; }
  .hero-art { width: clamp(200px, 28vw, 260px); margin-right: 10px; }
}

/* ==========================================================================
   Телефон
   ========================================================================== */

@media (max-width: 720px) {
  .header { min-height: 64px; gap: 10px; }
  .brand-mark { width: 26px; height: 34px; }
  .brand-name { font-size: 13px; }
  nav { gap: 6px 14px; font-size: 13px; }
  nav > a:first-child:not(.button) { display: none; }
  nav .button { min-height: 40px; padding: 8px 14px; font-size: 13px; }

  .hero { min-height: 0; }
  .hero-art { display: none; }
  .hero .button { width: 100%; }

  .catalogue, section.admin { padding-bottom: 56px; }
  .section-heading { margin-bottom: 18px; }
  section.admin .section-heading .button { width: 100%; }

  .actions { flex-direction: column; }
  .actions .button { width: 100%; }

  /* Таблица админки превращается в список карточек */
  .table-wrap { background: transparent; border: 0; overflow: visible; }
  table, tbody, tr, td { display: block; min-width: 0; width: 100%; }
  thead { display: none; }
  tbody { display: grid; gap: 12px; }
  tr { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 16px; }
  td { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); text-align: right; }
  td:first-child { text-align: left; }
  td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 700; flex: 0 0 auto; }
  td:first-child::before, td.table-actions::before { display: none; }
  tr td:last-child { border-bottom: 0; }
  td.table-actions { justify-content: flex-start; }
}

/* ==========================================================================
   Маленький телефон (320–380px)
   ========================================================================== */

@media (max-width: 380px) {
  .brand-mark { width: 23px; height: 30px; }
  .brand { gap: 8px; }
  nav { gap: 4px 10px; }
  .grid { gap: 14px; }
  .star { width: 40px; height: 40px; }
  input[type="file"]::file-selector-button { padding: 0 14px 0 40px; background-position: 12px center; margin-right: 10px; }
}

/* ==========================================================================
   Предпочтения пользователя
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* ==========================================================================
   Меню профиля
   ========================================================================== */

.ico { flex: 0 0 auto; }

.usermenu { position: relative; }

.avatar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 4px 10px 4px 4px;
  background: var(--panel);
  border: 1px solid #343846;
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.avatar-btn:hover, .usermenu.open .avatar-btn { border-color: var(--accent); color: var(--white); }
.avatar-btn > .ico { width: 16px; height: 16px; transition: transform .2s; }
.usermenu.open .avatar-btn > .ico { transform: rotate(180deg); }

.avatar {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2a3358, #3b2d63);
  color: var(--white);
}
.avatar .ico { width: 18px; height: 18px; }
.avatar.big { width: 42px; height: 42px; }
.avatar.big .ico { width: 22px; height: 22px; }
.avatar.xl { width: 72px; height: 72px; }
.avatar.xl .ico { width: 34px; height: 34px; }

.menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  width: min(290px, calc(100vw - 2 * var(--gutter)));
  padding: 8px;
  background: var(--panel);
  border: 1px solid #343846;
  border-radius: 16px;
  box-shadow: 0 24px 60px #000b, 0 0 0 1px #0006;
  animation: menu-in .16s ease-out;
  transform-origin: top right;
}
.menu-panel[hidden] { display: none; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px) scale(.97); } to { opacity: 1; transform: none; } }

.menu-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 14px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.menu-head > div { min-width: 0; flex: 1; }
.menu-head strong { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-head small { display: block; color: var(--muted); font-size: 12px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.menu-panel a[role="menuitem"] {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  color: #dcdee8;
  font-size: 14px;
  font-weight: 600;
  transition: background .12s, color .12s;
}
.menu-panel a[role="menuitem"] .ico { color: var(--muted); transition: color .12s; }
.menu-panel a[role="menuitem"]:hover, .menu-panel a[role="menuitem"]:focus-visible { background: var(--panel-2); color: var(--white); outline: none; }
.menu-panel a[role="menuitem"]:hover .ico, .menu-panel a[role="menuitem"]:focus-visible .ico { color: var(--accent); }
.menu-panel a.danger:hover, .menu-panel a.danger:focus-visible { background: #2d1a20; color: var(--danger); }
.menu-panel a.danger:hover .ico, .menu-panel a.danger:focus-visible .ico { color: var(--danger); }
.menu-sep { height: 1px; margin: 6px 4px; background: var(--line); }

/* ==========================================================================
   Фильтр каталога
   ========================================================================== */

.filter { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 24px; }

.seg {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.seg-item { position: relative; display: block; cursor: pointer; }
.seg-item input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg-item span {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 9px;
  color: #b9bcc9;
  font-size: 14px;
  font-weight: 800;
  transition: background .15s, color .15s;
}
.seg-item em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--muted); }
.seg-item:hover span { color: var(--white); }
.seg-item input:checked + span { background: var(--accent); color: #101109; }
.seg-item input:checked + span em { color: #3d4a07; }
.seg-item input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.empty a { color: var(--accent); font-weight: 700; }

/* ==========================================================================
   Подсказки полей, надёжность пароля
   ========================================================================== */

.panel .hint { display: block; min-height: 18px; margin-top: 7px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.hint.ok { color: #8fe388; }
.hint.bad { color: var(--danger); }
.hint.wait { color: var(--muted); }
.panel input.is-ok { border-color: #4f9a4a; }
.panel input.is-bad { border-color: #b4505e; }

.meter { display: grid; grid-template-columns: repeat(4, 1fr) auto; align-items: center; gap: 6px; margin: -4px 0 10px; }
.meter i { height: 5px; border-radius: 3px; background: #2a2d3a; transition: background .2s; }
.meter .meter-label { min-width: 92px; margin-left: 6px; color: var(--muted); font-size: 12.5px; font-weight: 700; text-align: right; }
.meter[data-level="1"] i:nth-child(-n+1) { background: #ef6a7a; }
.meter[data-level="1"] .meter-label { color: #ef8a97; }
.meter[data-level="2"] i:nth-child(-n+2) { background: #f0b34a; }
.meter[data-level="2"] .meter-label { color: #f0b34a; }
.meter[data-level="3"] i:nth-child(-n+3) { background: #a8d94a; }
.meter[data-level="3"] .meter-label { color: #a8d94a; }
.meter[data-level="4"] i { background: #5fd36f; }
.meter[data-level="4"] .meter-label { color: #5fd36f; }

.rules { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.rules li { display: flex; align-items: center; gap: 8px; }
.rules li::before { content: ""; flex: 0 0 auto; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid #4a4f60; transition: background .15s, border-color .15s; }
.rules li.done { color: #b9e8b4; }
.rules li.done::before {
  border-color: #5fd36f;
  background: #5fd36f url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='m3.5 7.2 2.3 2.3 4.7-4.9' fill='none' stroke='%23101109' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
}

.button:disabled { opacity: .45; cursor: not-allowed; filter: none; transform: none; }

.notice { padding: 10px 12px; background: #1d2a14; color: #c4ee7c; border-radius: 8px; }

/* ==========================================================================
   Подтверждение почты
   ========================================================================== */

.verify .lead { margin: -8px 0 20px; color: #c0c3cf; line-height: 1.65; }
.verify .lead strong { color: var(--white); }
.verify.center { text-align: center; }
.verify.center h1 { margin-top: 0; }

.verify-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 0 16px;
  border-radius: 16px;
  background: #212a14;
  color: var(--accent);
}
.verify-icon .ico { width: 28px; height: 28px; }
.verify.center .verify-icon { margin-inline: auto; }
.verify-icon.ok { background: #16301d; color: #5fd36f; }
.verify-icon.bad { background: #3a1d25; color: var(--danger); }

.panel .code-input {
  text-align: center;
  font: 700 30px/1 "Courier New", Consolas, monospace;
  letter-spacing: .5em;
  padding: 16px 12px 16px calc(12px + .5em);
  color: var(--accent);
}
.panel .code-input::placeholder { color: #3a3e4c; }

.resend { margin: 4px 0 0; }
.alt { margin: 18px 0 4px; border-top: 1px solid var(--line); padding-top: 14px; }
.alt summary { cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 700; padding: 6px 0; }
.alt summary:hover { color: var(--white); }
.verify p:last-child a { color: var(--accent); }

/* ==========================================================================
   Сообщение сверху (flash)
   ========================================================================== */

.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 1210px;
  margin: 16px auto 0;
  padding: 12px 16px;
  width: calc(100% - 2 * var(--gutter));
  background: #16301d;
  border: 1px solid #2c5a37;
  border-radius: 10px;
  color: #bdf0c5;
  font-weight: 700;
}
.flash .ico { color: #5fd36f; }

/* ==========================================================================
   Профиль
   ========================================================================== */

.account { max-width: 760px; margin: clamp(24px, 5vw, 50px) auto 70px; padding: 0 var(--gutter); display: grid; gap: 16px; }

.profile-card {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  padding: clamp(18px, 4vw, 26px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.profile-main { flex: 1; min-width: 0; }
.profile-main h1 { margin: 0 0 6px; font-size: clamp(20px, 4.4vw, 26px); }
.profile-mail { margin: 0; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.chip { display: inline-block; padding: 5px 10px; border-radius: 999px; background: var(--panel-2); border: 1px solid #343846; color: #cfd1db; font-size: 12px; font-weight: 700; }
.chip.ok { background: #16301d; border-color: #2c5a37; color: #8fe388; }
.chip.admin { background: var(--accent); border-color: var(--accent); color: #101109; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.stat { padding: 18px 20px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.stat strong { display: block; font: 700 22px/1.2 var(--font-display); letter-spacing: -.03em; }
.stat span { color: var(--muted); font-size: 13px; }

.panel-title { margin: 0 0 14px; font-size: 16px; }
.muted-text { margin: 0; color: var(--muted); line-height: 1.7; }
.muted-text a, .account-links a { color: var(--accent); font-weight: 700; }
.account-links { margin: 4px 0 0; text-align: center; }

.rated-list { list-style: none; margin: 0; padding: 0; }
.rated-list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rated-list li:last-child { border-bottom: 0; }
.rated-list a { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rated-list a:hover { color: var(--accent); }
.rated-list .stars { letter-spacing: 1px; white-space: nowrap; }
.rated-list .dim { color: #3c404d; }

@media (max-width: 720px) {
  .filter .button { flex: 1 0 100%; }
  .seg { width: 100%; }
  .seg-item { flex: 1; }
  .seg-item span { justify-content: center; padding: 0 8px; }
  .profile-card { flex-direction: column; text-align: center; }
  .profile-mail { justify-content: center; }
}

/* ==========================================================================
   Аватарки
   ========================================================================== */

.avatar { overflow: hidden; flex: 0 0 auto; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.letter {
  background: linear-gradient(135deg, hsl(var(--h1) 48% 36%), hsl(var(--h2) 52% 24%));
  font-weight: 800;
  font-size: 15px;
  line-height: 1;
}
.avatar.sm { width: 40px; height: 40px; }
.avatar.big.letter { font-size: 18px; }
.avatar.xl.letter { font-size: 30px; }
.avatar.xxl { width: 132px; height: 132px; }
.avatar.xxl.letter { font-size: 54px; }
.avatar.ring { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px #343846; }
.avatar.ring.online { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent); }

.chip.sm { padding: 2px 8px; font-size: 11px; }

/* ==========================================================================
   Профиль
   ========================================================================== */

.pf {
  position: relative;
  isolation: isolate;
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 44px) var(--gutter) 80px;
}
.pf::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 420px;
  background: radial-gradient(110% 100% at 12% 0, rgba(182, 140, 255, .18), transparent 62%);
  pointer-events: none;
  z-index: -1;
}
.pf-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; line-height: 0; }
.pf-top > .avatar { margin: 5px; }
.pf-menu .menu-panel { top: calc(100% + 6px); }

.icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color .15s, background .15s, border-color .15s;
}
.icon-btn:hover, .usermenu.open .icon-btn { color: var(--white); background: var(--panel); border-color: #343846; }

.pf-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 18px 0 8px; font-size: clamp(24px, 6vw, 36px); line-height: 1.15; }
.pf-meta { display: flex; align-items: center; gap: 9px; margin: 2px 0; color: var(--muted); font-size: 15px; line-height: 1.4; }
.pf-meta .ico { width: 17px; height: 17px; flex: 0 0 auto; }
.pf-meta.online { color: #8fe388; }

.tabs {
  display: flex;
  gap: 4px;
  margin: 22px 0 22px;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  transition: color .15s, background .15s;
}
.tab .ico { width: 18px; height: 18px; }
.tab:hover { color: var(--white); }
.tab.active { background: #06070b; color: var(--white); }

.menu-panel button[role="menuitem"] {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: #dcdee8;
  font: 600 14px var(--font-body);
  text-align: left;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.menu-panel button[role="menuitem"] .ico { color: var(--muted); transition: color .12s; }
.menu-panel button[role="menuitem"]:hover, .menu-panel button[role="menuitem"]:focus-visible { background: var(--panel-2); color: var(--white); outline: none; }
.menu-panel button[role="menuitem"]:hover .ico, .menu-panel button[role="menuitem"]:focus-visible .ico { color: var(--accent); }

/* Список комментариев пользователя (вкладка профиля) */
.plist { display: grid; gap: 14px; }
.pcard {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.pcard-title { margin: 0; color: var(--muted); line-height: 1.5; }
.pcard-title b { color: var(--white); }
.pcard-time { display: block; margin: 2px 0 10px; color: var(--muted); font-size: 13px; }
.pcard-body { margin: 0; line-height: 1.65; color: #e6e8f0; }
.pcard-foot { display: flex; justify-content: flex-end; margin-top: 14px; }
.pcard-foot .button { min-height: 40px; }

/* ==========================================================================
   Комментарии
   ========================================================================== */

.comments-wrap { max-width: 1120px; margin: 0 auto 80px; padding: 0 var(--gutter); }
.comments-wrap .comments { max-width: 820px; }

.c-title { margin: 0 0 20px; font-size: clamp(20px, 4.6vw, 26px); }
.c-title span { color: var(--muted); font-weight: 500; }

.c-formbox, .c-gate {
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.c-gate { display: grid; justify-items: center; gap: 6px; padding: 26px 18px; text-align: center; }
.c-gate a { padding: 8px 16px; color: var(--accent); font-weight: 800; }

.c-form textarea {
  display: block;
  width: 100%;
  min-height: 92px;
  padding: 12px;
  background: #090b11;
  border: 1px solid #363945;
  border-radius: 10px;
  color: var(--white);
  font: inherit;
  font-size: 16px;
  line-height: 1.5;
  resize: vertical;
  transition: border-color .15s, box-shadow .15s;
}
.c-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(216, 255, 62, .15); }
.c-form-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; }
.c-count { color: var(--muted); font-size: 12.5px; font-weight: 600; }

.c-empty { margin: 26px 0 0; color: var(--muted); }
.c-list { margin-top: 18px; }

.comment {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0 14px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 90px;
}
.c-list > .comment:first-child { border-top: 0; }
.c-av { display: block; flex: 0 0 40px; width: 40px; line-height: 0; }
.c-av .avatar { display: grid; }
.c-main { flex: 1 1 0; min-width: 0; }
.c-head { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; line-height: 1.3; }
.c-name { font-weight: 800; font-size: 16px; color: var(--white); }
.c-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.c-to { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 13px; font-weight: 600; }
.c-to .ico { width: 14px; height: 14px; }
.c-time { margin-left: auto; color: var(--muted); font-size: 13px; }
.c-text { margin: 4px 0 4px; line-height: 1.55; color: #e6e8f0; }

.c-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; margin: 0 0 0 -10px; }
.c-votes, .c-del { display: inline-flex; gap: 2px; margin: 0; }
.vote, .c-act {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--muted);
  font: 700 13px var(--font-body);
  cursor: pointer;
  transition: color .15s, background .15s;
}
.vote .ico, .c-act .ico { width: 18px; height: 18px; }
span.vote { cursor: default; }
button.vote:hover:not(:disabled), .c-act:hover { color: var(--white); background: var(--panel-2); }
.vote.up.on { color: var(--accent); }
.vote.down.on { color: var(--danger); }
.vote.on .ico { fill: currentColor; fill-opacity: .22; }
button.vote:disabled { cursor: default; opacity: .6; }
.c-act.danger:hover { color: var(--danger); background: #2d1a20; }

.c-reply summary { list-style: none; }
.c-reply summary::-webkit-details-marker { display: none; }
.c-reply[open] { flex: 1 0 100%; order: 5; margin: 6px 0 4px 10px; }
.c-reply[open] summary { margin: 0 0 8px -10px; color: var(--white); }
.c-reply .c-form { padding: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }

.replies { flex: 0 0 auto; width: calc(100% - 54px); margin: 6px 0 0 54px; padding-left: 16px; border-left: 2px solid var(--line); }
.replies .comment { gap: 0 12px; padding: 10px 0; border-top: 0; }
.replies .c-av { flex-basis: 34px; width: 34px; }
.replies .avatar.sm { width: 34px; height: 34px; }

.c-pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 22px; }
.c-pager .button { min-height: 40px; }
.c-pageno { color: var(--muted); font-size: 13px; font-weight: 700; }

.comment:target { animation: c-flash 2.2s ease-out; }
@keyframes c-flash { from { background: rgba(216, 255, 62, .12); } to { background: transparent; } }

/* ==========================================================================
   Всплывающая карточка пользователя
   ========================================================================== */

.ucard {
  position: fixed;
  z-index: 60;
  width: min(340px, calc(100vw - 16px));
  padding: 16px;
  background: var(--panel);
  border: 1px solid #343846;
  border-radius: 16px;
  box-shadow: 0 24px 60px #000b;
  animation: menu-in .14s ease-out;
}
.ucard[hidden] { display: none; }
.uc-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; }
.uc-name { font-weight: 800; font-size: 17px; color: var(--white); }
.uc-line { display: block; margin-top: 10px; color: var(--muted); font-size: 13.5px; }
.uc-line.online { color: #8fe388; }
.uc-line + .uc-line { margin-top: 4px; }
.uc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.uc-stat { padding: 10px 6px; text-align: center; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; }
.uc-stat strong { display: block; font-size: 20px; line-height: 1.2; }
.uc-stat span { color: var(--muted); font-size: 12px; }

/* ==========================================================================
   Настройки: аватар; сообщение об ошибке сверху
   ========================================================================== */

.av-edit { display: flex; align-items: center; gap: 18px; margin: 4px 0 6px; }
.av-edit label { flex: 1; margin: 0; }
.panel label small { display: block; margin-top: 8px; line-height: 1.4; }
.auth .panel + .av-remove, .auth .av-remove + .panel, .auth .panel + .panel { margin-top: 16px; }
.av-remove { margin-top: 12px; }

.flash.err { background: #3e1d26; border-color: #6a2d3a; color: #ffadb9; }
.flash.err .ico { color: var(--danger); }

@media (max-width: 720px) {
  .pf-name { margin-top: 22px; }
  .avatar.xxl { width: 112px; height: 112px; }
  .avatar.xxl.letter { font-size: 44px; }
  .comment { column-gap: 12px; }
  .c-av { flex-basis: 36px; width: 36px; }
  .comment .avatar.sm { width: 36px; height: 36px; }
  .replies { width: calc(100% - 48px); margin-left: 48px; padding-left: 12px; }
  .pub-row { font-size: 14px; }
  .pcard { grid-template-columns: minmax(0, 1fr); }
  .pcard > .avatar { display: none; }
  .pcard-foot .button { width: 100%; }
  .av-edit { flex-direction: column; align-items: stretch; }
  .av-edit > div { align-self: center; }
}

@media (prefers-reduced-motion: reduce) {
  .comment:target, .ucard { animation: none !important; }
}

/* ==========================================================================
   Страница плейлиста: «Опубликовал / Опубликовано / Обновление плейлиста»
   ========================================================================== */

.pub { display: grid; gap: 12px; margin: 22px 0 6px; padding-top: 18px; border-top: 1px solid var(--line); }
.pub-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--muted); font-size: 15px; line-height: 1.4; }
.pub-row .ico { width: 20px; height: 20px; flex: 0 0 auto; }
.pub-row time { color: var(--white); font-weight: 600; }
.pub-avatar { display: block; flex: 0 0 auto; line-height: 0; }
.pub-name { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; color: var(--white); }
a.pub-name:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ==========================================================================
   Телефон: аккуратные отступы (комментарии, вкладки профиля, «Опубликовал»)
   ========================================================================== */

.pub-row time { white-space: nowrap; }

@media (max-width: 720px) {
  /* время идёт сразу за именем/бейджем, а не прижато вправо отдельной строкой */
  .c-time { margin-left: 0; }
  .c-head { gap: 2px 8px; }

  /* лайк / дизлайк / ответить / удалить — в одну строку */
  .c-actions { gap: 0; }
  .vote, .c-act { gap: 5px; padding: 0 8px; }
  .c-votes, .c-del { gap: 0; }

  /* вкладки профиля делят ширину поровну и не прокручиваются */
  .tabs { gap: 2px; }
  .tab { flex: 1 1 0; justify-content: center; gap: 7px; padding: 0 8px; font-size: 13px; }
  .tab .ico { width: 16px; height: 16px; }

  /* «Обновление плейлиста: 18 минут назад» не переносится под иконку */
  .pub-row { flex-wrap: nowrap; }
}


/* ==========================================================================
   Админ-панель: вкладки, главная, пользователи, заявки
   ========================================================================== */

.admin-tabs { margin-top: 0; }
.admin-tabs .tab { position: relative; }
.tab-badge {
  min-width: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #101109;
  font: 800 11px/1.3 var(--font-body);
  font-style: normal;
  text-align: center;
}

.chip.bad { background: #3a1d25; border-color: #6a2d3a; color: #ffadb9; }
.chip.wait { background: #2e2a14; border-color: #5d5424; color: #f2d86a; }
.eyebrow.danger { color: var(--danger); }

.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
.dash-card {
  display: grid;
  gap: 4px;
  padding: 18px 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .15s, transform .15s;
}
a.dash-card:hover { border-color: var(--accent); }
.dash-card.hot { border-color: var(--accent); }
.dash-label { color: var(--muted); font-size: 13px; font-weight: 700; }
.dash-card strong { font: 700 clamp(26px, 5vw, 32px)/1.1 var(--font-display); letter-spacing: -.03em; }
.dash-card small { color: var(--muted); font-size: 12.5px; }

.dash-panel { margin-bottom: 18px; }
.dash-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.dash-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.dash-head .panel-title { margin: 0; }
.dash-head a { color: var(--accent); font-size: 13px; font-weight: 700; white-space: nowrap; }

.bars { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding-top: 18px; }
.bar-col { position: relative; display: flex; flex: 1 1 0; min-width: 0; height: 100%; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.bar-col i { display: block; width: 100%; max-width: 30px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--accent), #8fb21f); }
.bar-n { color: var(--white); font-size: 11px; font-weight: 800; }
.bar-l { color: var(--muted); font-size: 10px; white-space: nowrap; }

.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mini-list li:last-child { border-bottom: 0; }
.mini-main { flex: 1; min-width: 0; }
.mini-main a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.mini-main a:hover { color: var(--accent); }
.mini-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12.5px; }
.mini-time { color: var(--muted); font-size: 12.5px; white-space: nowrap; }

.user-search { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.user-search input, .user-search select {
  min-height: 46px;
  padding: 0 14px;
  background: var(--panel);
  border: 1px solid #363945;
  border-radius: 10px;
  color: var(--white);
  font: inherit;
  font-size: 16px;
}
.user-search input { flex: 1 1 240px; min-width: 0; }
.user-search input:focus, .user-search select:focus { outline: none; border-color: var(--accent); }
.user-search .button { min-width: 100px; }

.u-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.u-cell small { margin-top: 2px; }
.cell-email { overflow-wrap: anywhere; font-size: 13.5px; }
.status-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

.filter-links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.fl {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted); font-weight: 700; font-size: 13.5px;
}
.fl em { font-style: normal; font-size: 12px; color: var(--muted); }
.fl:hover { color: var(--white); }
.fl.active { background: var(--accent); border-color: var(--accent); color: #101109; }
.fl.active em { color: #101109; }

.user-page { display: grid; gap: 16px; max-width: 760px; }
.user-page .panel + .panel, .user-page .panel + form { margin-top: 0; }
.u-top { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.u-top-main { min-width: 0; }
.u-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 4px; font-size: clamp(18px, 4.5vw, 22px); }
.u-name a { color: var(--accent); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0 0 12px; }
.facts div { padding: 12px 14px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; }
.facts dt { color: var(--muted); font-size: 12px; font-weight: 700; }
.facts dd { margin: 3px 0 0; font-weight: 800; }
.ban-box { border-color: #6a2d3a; }
.ban-box .panel-title { margin-top: 6px; }
.ban-box .muted-text { margin-bottom: 8px; text-align: left; }
.ban-box form { margin-top: 14px; }
.ban-hint { margin-bottom: 8px; font-size: 13.5px; }
.ban-custom { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ban-custom[hidden] { display: none; }
.danger-btn { background: #c4434f; color: #fff; }
.button.ghost.danger-btn { background: transparent; color: var(--danger); border-color: #6a2d3a; }
.button.ghost.danger-btn:hover { border-color: var(--danger); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.btn-row .button { flex: 1 1 150px; }
.del-form { text-align: center; }
.linklike { background: none; border: 0; padding: 8px; font: inherit; font-size: 13px; cursor: pointer; }
.linklike.danger { color: var(--danger); }
.linklike:hover { text-decoration: underline; }

/* Формы с чекбоксами и фотографиями */
.panel input[type="checkbox"] { display: inline-block; width: auto; margin: 0 8px 0 0; padding: 0; accent-color: var(--accent); vertical-align: -3px; }
.chk { display: flex; align-items: center; margin: 10px 0 !important; color: var(--muted); font-weight: 600 !important; }
.field-group { margin: 14px 0; }
.field-title { font-weight: 700; font-size: 13px; }
.field-title small { color: var(--muted); font-weight: 500; }
.slots { display: grid; gap: 12px; margin-top: 8px; }
.slot { padding: 14px; background: #0c0e15; border: 1px solid var(--line); border-radius: 12px; }
.slot-head { margin-bottom: 8px; font-size: 13px; }
.slot-head small { color: var(--muted); font-weight: 500; }
.slot-thumb { width: 100%; max-width: 280px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; background: #222; margin-bottom: 8px; }
.slot-thumb[hidden] { display: none; }
.slot input[type="url"] { margin-top: 8px; }
.slot-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.slot-row .slot-thumb { width: 180px; margin: 0; }
.panel .intro { margin: -8px 0 14px; font-size: 14px; text-align: left; }
.panel .note { margin: -2px 0 8px; font-size: 12.5px; text-align: left; color: var(--muted); }

.sub-list { list-style: none; margin: 0; padding: 0; }
.sub-list li { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.sub-list li:last-child { border-bottom: 0; }
.sub-main { min-width: 0; }
.sub-main a, .sub-main strong { display: block; font-weight: 800; overflow-wrap: anywhere; }
.sub-main a { color: var(--accent); }
.sub-main small { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; }
.sub-main .reason { color: #ffadb9; }

.theme-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }

/* ==========================================================================
   Страница плейлиста: галерея до 3 фотографий
   ========================================================================== */

.gallery { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 15px; background: #222; }
.gallery:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.g-track {
  display: flex; height: 100%;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.g-track::-webkit-scrollbar { display: none; }
.g-slide { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: center; scroll-snap-stop: always; }

.g-nav {
  position: absolute; top: 50%; z-index: 2;
  display: grid; place-items: center;
  width: 44px; height: 44px; margin-top: -22px; padding: 0;
  border: 0; border-radius: 50%;
  background: rgba(9, 10, 15, .62); color: #fff;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  cursor: pointer; transition: background .15s, opacity .15s;
}
.g-nav:hover { background: rgba(9, 10, 15, .85); }
.g-nav.prev { left: 10px; }
.g-nav.next { right: 10px; }
.g-nav[disabled] { opacity: 0; pointer-events: none; }
.g-nav .ico { width: 22px; height: 22px; }

.g-count {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(9, 10, 15, .62); color: #fff; font-size: 12px; font-weight: 800;
}
.g-dots { position: absolute; left: 0; right: 0; bottom: 10px; z-index: 2; display: flex; justify-content: center; gap: 4px; }
.g-dot { position: relative; width: 24px; height: 24px; padding: 0; border: 0; background: none; cursor: pointer; }
.g-dot::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px;
  border-radius: 50%; background: rgba(255, 255, 255, .5); transition: background .15s, transform .15s;
}
.g-dot.active::after { background: var(--accent); transform: scale(1.25); }

@media (hover: none) { .g-nav { display: none; } } /* на телефоне листаем свайпом */

/* ==========================================================================
   Страница блокировки
   ========================================================================== */

.ban-page { text-align: center; }
.ban-page h1 { margin-top: 6px; }
.ban-page .lead { color: var(--muted); line-height: 1.7; margin: 0 0 18px; }
.ban-facts { display: grid; gap: 10px; margin: 0 0 18px; text-align: left; }
.ban-facts div { padding: 12px 14px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; }
.ban-facts dt { color: var(--muted); font-size: 12px; font-weight: 700; }
.ban-facts dd { margin: 4px 0 0; font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; }
.ban-facts small { display: block; margin-top: 2px; font-weight: 500; }
.muted { color: var(--muted); font-weight: 500; }

@media (max-width: 900px) {
  .dash-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .admin-tabs { justify-content: flex-start; overflow-x: auto; }
  .admin-tabs .tab { flex: 0 0 auto; padding: 0 12px; }
  .admin-tabs .tab .ico { display: none; }
  .bars { gap: 3px; }
  .bar-l { display: none; }
  .bar-col:nth-child(odd) .bar-l { display: block; font-size: 9px; }
  .u-cell { text-align: left; }
  .status-chips { justify-content: flex-end; }
  .ban-custom { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .btn-row .button { flex: 1 1 100%; }
  .user-search .button { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .g-track { scroll-behavior: auto; }
}

@media (max-width: 460px) {
  /* четыре вкладки профиля на узком экране: без иконок, чтобы поместились */
  .pf .tab .ico { display: none; }
  .pf .tab { padding: 0 4px; font-size: 12px; }
}


/* ==========================================================================
   Уведомления: колокольчик, выпадающая панель, страница /notifications
   ========================================================================== */

.notif { position: relative; }

.bell-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: var(--panel);
  border: 1px solid #343846;
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.bell-btn:hover, .notif.open .bell-btn { border-color: var(--accent); color: var(--white); }
.bell-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  padding: 2px 5px;
  border-radius: 999px;
  background: var(--accent);
  border: 2px solid var(--bg);
  color: #101109;
  font: 800 11px/1.2 var(--font-body);
  text-align: center;
}
.bell-badge[hidden] { display: none; }

.notif-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: -60px;
  z-index: 30;
  width: min(400px, calc(100vw - 2 * var(--gutter)));
  background: var(--panel);
  border: 1px solid #343846;
  border-radius: 16px;
  box-shadow: 0 24px 60px #000b, 0 0 0 1px #0006;
  animation: menu-in .16s ease-out;
  transform-origin: top right;
  overflow: hidden;
}
.notif-panel[hidden] { display: none; }
.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.notif-head strong { font: 700 14px/1 var(--font-display); letter-spacing: -.02em; }
.n-readall {
  padding: 4px 0;
  background: none;
  border: 0;
  color: var(--accent);
  font: 700 13px/1.2 var(--font-body);
  cursor: pointer;
}
.n-readall:hover { text-decoration: underline; text-underline-offset: 3px; }
.n-readall[hidden] { display: none; }
.notif-panel .n-list { max-height: min(460px, 65vh); overflow-y: auto; overscroll-behavior: contain; }
.notif-foot {
  display: block;
  padding: 13px 16px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
}
.notif-foot:hover { background: var(--panel-2); }

.n-list { list-style: none; margin: 0; padding: 0; }
.notif-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid #1d202b;
}
.notif-item:last-child { border-bottom: 0; }
.notif-item.unread { background: #16190f; }
.notif-item.unread::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
}
.n-av { flex: 0 0 auto; }
.n-body { flex: 1; min-width: 0; }
.n-body p { margin: 0; }
.n-line { font-size: 14px; line-height: 1.45; color: #cfd1db; overflow-wrap: anywhere; }
.n-actor { font-weight: 800; color: var(--white); }
.n-actor:hover { text-decoration: underline; text-underline-offset: 3px; }
.n-text { color: #cfd1db; }
.n-text:hover { color: var(--white); }
.n-text.strong { color: var(--white); font-weight: 800; }
.n-sub { margin-top: 3px !important; font-size: 13px; color: var(--muted); }
.n-rate { color: var(--muted); font-weight: 700; }
.n-stars { color: #ffe26a; letter-spacing: 1px; }
.n-quote {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 5px;
  padding-left: 10px;
  border-left: 2px solid #343846;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.n-quote:hover { color: #cfd1db; border-left-color: var(--accent); }
.n-time { display: block; margin-top: 5px; font-size: 12px; color: #6f7384; }
.n-ico {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--muted);
}
.n-ico .ico { width: 15px; height: 15px; }
.n-ico-comment_like { color: var(--accent); }
.n-ico-rating { color: #ffe26a; }
.n-ico-submission_approved { color: #8fe388; background: #16301d; }
.n-empty { padding: 28px 20px; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.6; }

.notif-page { max-width: 760px; margin: 0 auto; padding: 30px var(--gutter) 80px; }
.n-list-page {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

@media (max-width: 560px) {
  /* на узком экране панель растягивается по ширине шапки */
  .notif { position: static; }
  .notif-panel { top: calc(100% + 8px); left: 12px; right: 12px; width: auto; transform-origin: top center; }
}

/* ---------- Вход через форум ---------- */
.auth-sep { display: flex; align-items: center; gap: 12px; margin: 18px 0 6px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.auth-sep::before, .auth-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.forum-btn { gap: 9px; margin-top: 12px; }
.forum-btn .ico { flex: none; }
.panel p.auth-note { margin: 10px 0 0; color: var(--muted); font-size: 12.5px; text-align: center; }
.panel p.auth-note + p { margin-top: 18px; }


/* =====================================================================
   Роли, красный ник Владельца, запрет комментариев, модерация
   ===================================================================== */
/* Ник Владельца и Зама.Владельца: цвет роли + свечение + круглая галочка (цвет берётся из роли: --nc-owner / --nc-deputy) */
.nick-owner { --nc: var(--nc-owner, #ff2d4a); }
.nick-deputy { --nc: var(--nc-deputy, #ff8a3d); }
.nick-owner,
.nick-deputy,
a.nick-owner:hover,
a.nick-deputy:hover {
  color: var(--nc);
  text-shadow: 0 0 6px color-mix(in srgb, var(--nc) 85%, transparent), 0 0 16px color-mix(in srgb, var(--nc) 55%, transparent), 0 0 30px color-mix(in srgb, var(--nc) 30%, transparent);
  animation: nick-glow 3.2s ease-in-out infinite;
}
.nick-owner::after,
.nick-deputy::after {
  content: "";
  display: inline-block;
  flex: none;
  width: .9em;
  height: .9em;
  margin-left: .38em;
  vertical-align: -.1em;
  border-radius: 50%;
  background: var(--nc) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23100d12' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6.5 12.5 3.8 3.8 7.2-8.3'/%3E%3C/svg%3E") center / 76% no-repeat;
  box-shadow: 0 0 8px color-mix(in srgb, var(--nc) 70%, transparent), 0 0 18px color-mix(in srgb, var(--nc) 35%, transparent);
  text-shadow: none;
  animation: none;
}
.pf-name.nick-owner,
.pf-name.nick-deputy { color: inherit; text-shadow: none; animation: none; }
.pf-name.nick-owner::after,
.pf-name.nick-deputy::after { margin-left: -2px; width: .78em; height: .78em; }
.pf-name.nick-owner > span,
.pf-name.nick-deputy > span {
  color: var(--nc);
  text-shadow: 0 0 8px color-mix(in srgb, var(--nc) 85%, transparent), 0 0 20px color-mix(in srgb, var(--nc) 55%, transparent), 0 0 38px color-mix(in srgb, var(--nc) 30%, transparent);
  animation: nick-glow 3.2s ease-in-out infinite;
}
@keyframes nick-glow {
  0%, 100% { text-shadow: 0 0 6px color-mix(in srgb, var(--nc) 85%, transparent), 0 0 16px color-mix(in srgb, var(--nc) 50%, transparent), 0 0 30px color-mix(in srgb, var(--nc) 25%, transparent); }
  50% { text-shadow: 0 0 9px var(--nc), 0 0 22px color-mix(in srgb, var(--nc) 70%, transparent), 0 0 40px color-mix(in srgb, var(--nc) 40%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
  .nick-owner, .nick-deputy, .pf-name.nick-owner > span, .pf-name.nick-deputy > span { animation: none; }
}

/* Бейджи ролей */
.role-chain { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 4px; }
.role-chip {
  --rc: #9aa0b4;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--rc);
  background: #151822;
  color: var(--rc);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
  letter-spacing: .01em;
  white-space: nowrap;
}
.role-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--rc); box-shadow: 0 0 6px var(--rc); flex: none; }
@supports (background: color-mix(in srgb, red 10%, transparent)) {
  .role-chip { background: color-mix(in srgb, var(--rc) 13%, #0d0f16); border-color: color-mix(in srgb, var(--rc) 50%, transparent); }
}
.role-chip.is-owner { box-shadow: 0 0 14px rgba(255, 45, 74, .35); border-color: #ff2d4a; }
.role-sep { display: inline-block; width: 10px; height: 10px; position: relative; flex: none; }
.role-sep::before {
  content: "";
  position: absolute;
  left: 1px; top: 1px;
  width: 6px; height: 6px;
  border-top: 2px solid #4b5062;
  border-right: 2px solid #4b5062;
  transform: rotate(45deg);
}

.hdr-roles { display: none; max-width: 42vw; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
.hdr-roles .role-chain { flex-wrap: nowrap; }
@media (min-width: 1000px) { .hdr-roles { display: block; margin-right: 4px; } }
.menu-roles { padding: 0 10px 12px; margin-top: -2px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.pf-roles { margin: 0 0 10px; }
.uc-roles { margin-top: 10px; }

/* Запрет комментариев */
.c-gate.c-muted { justify-content: flex-start; background: #2a1a20; border-color: #6a2d3a; color: #ffadb9; }
.c-gate.c-muted .ico { vertical-align: -4px; margin-right: 4px; }

/* Удаление комментария модератором */
.c-modform { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.c-modform input[type="text"] { flex: 1 1 220px; min-width: 0; }
.c-modform .button { height: 42px; }

/* Уведомление об удалении комментария */
.n-mod { display: inline-block; padding: 1px 7px; border-radius: 6px; background: #3a1d25; color: #ffadb9; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; vertical-align: 1px; }
.n-quote-gone { text-decoration: line-through; text-decoration-color: rgba(250, 145, 157, .5); cursor: default; }
.n-reason { color: #ffadb9; }
.n-reason b { color: var(--white); }
.n-ico-comment_removed, .n-ico-comment_removed_thread { color: var(--danger); }

/* Админка: комментарии */
.mod-list { display: grid; gap: 12px; margin-top: 18px; }
.mod-item { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.mod-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.mod-head strong a { font-weight: 800; }
.mod-where { color: var(--muted); font-size: 13px; }
.mod-where a { color: var(--accent); font-weight: 700; }
.mod-time { margin-left: auto; color: var(--muted); font-size: 12.5px; }
.mod-body { margin: 10px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; color: #e4e6ee; line-height: 1.5; }
.mod-actions { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: flex-start; margin-top: 12px; }
.mod-actions details { flex: 1 1 100%; }
.mod-actions summary { cursor: pointer; display: inline-block; color: var(--danger); font-weight: 700; font-size: 14px; }
.mod-actions .mod-link { color: var(--muted); font-size: 14px; font-weight: 700; }
.mod-actions .mod-link:hover { color: var(--accent); }
.mod-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.mod-form input[type="text"] { flex: 1 1 260px; min-width: 0; }
.mod-form .button { height: 44px; }

/* Админка: роли */
.role-table { display: grid; gap: 10px; margin-top: 18px; }
.role-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.role-row form.role-edit { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.role-row label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 700; }
.role-row input[type="text"] { min-width: 160px; }
.role-row input[type="number"] { width: 84px; }
.role-row input[type="color"] { width: 54px; height: 44px; padding: 3px; border-radius: 10px; cursor: pointer; background: var(--panel-2); border: 1px solid var(--line); }
.role-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; color: var(--muted); font-size: 13px; }
.role-row .button { height: 44px; }
.role-pick { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); margin: 12px 0 16px; }
.role-pick label { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.role-pick input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.role-pick label.locked { opacity: .55; cursor: not-allowed; }
@media (max-width: 640px) {
  .role-row { grid-template-columns: 1fr; }
  .role-row input[type="text"] { min-width: 0; width: 100%; }
  .mod-time { margin-left: 0; width: 100%; }
}


/* ---------- Страница временной ссылки ---------- */
.link-page { display: grid; gap: 14px; justify-items: start; }
.link-page h1 { margin: 0; word-break: break-word; }
.link-box {
  width: 100%; padding: 14px 16px; border: 1px solid var(--accent); border-radius: 10px;
  background: var(--bg); color: var(--white); font-size: .95rem; word-break: break-all; user-select: all;
}
.link-timer b { color: var(--accent); font-variant-numeric: tabular-nums; }


/* ==========================================================================
   Поддержка плейлистов: список запросов, переписка, вложения
   ========================================================================== */

.support-page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; max-width: 860px; margin: 0 auto; width: 100%; }
.support-page.auth { max-width: 720px; margin: clamp(20px, 5vw, 55px) auto 70px; padding: 0 var(--gutter); }
.support-page .panel, .support-ticket .panel { margin: 0; }
.support-ticket { max-width: 860px; margin-left: auto; margin-right: auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.support-ticket:not(.admin) { margin-top: clamp(20px, 5vw, 44px); margin-bottom: 70px; padding: 0 var(--gutter); }
.support-ticket > *, .support-page > * { min-width: 0; }
.support-ticket.admin { max-width: 1100px; }
.support-ticket .tabs { margin-bottom: 0; }
.sp-back { margin: 0; font-size: 14px; }
.sp-back a { color: var(--accent); font-weight: 700; }

.sp-top { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.sp-top > div { flex: 1 1 280px; min-width: 0; }
.sp-top h1 { margin-bottom: 10px; }
.sp-top .button { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; }
.sp-top .button .ico { width: 18px; height: 18px; }
.sp-count { display: inline-block; margin-left: 6px; padding: 1px 9px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); font: 700 12px/1.6 var(--font-body); vertical-align: 2px; }
.sp-empty { margin: 4px 0 0; }
.sp-list li { align-items: flex-start; }
.sp-list .chip { flex: 0 0 auto; white-space: nowrap; }
.sp-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.sp-filters .chip { padding: 7px 14px; font-size: 13px; transition: border-color .15s; }
.sp-filters a.chip:hover { border-color: var(--accent); }

.sp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.sp-head-main { flex: 1 1 280px; min-width: 0; }
.sp-head h1 { margin: 6px 0 12px; overflow-wrap: anywhere; }
.sp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; text-align: left; font-size: 13px; }
.sp-meta a { color: var(--accent); font-weight: 700; }
.sp-actions { margin: 0; flex: 0 0 auto; }
.sp-actions .button { width: auto; }

.sp-thread { display: grid; gap: 12px; }
.sp-msg { display: flex; gap: 12px; align-items: flex-start; }
.sp-av { flex: 0 0 auto; }
.sp-bubble {
  flex: 1 1 auto;
  min-width: 0;
  max-width: calc(100% - 52px);
  padding: 13px 16px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.sp-msg.staff .sp-bubble { background: #141a10; border-color: #34451e; }
.sp-bubble header { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-bottom: 8px; }
.sp-name { font-weight: 800; font-size: 14px; overflow-wrap: anywhere; }
.sp-bubble time { margin-left: auto; color: var(--muted); font-size: 12px; }
.sp-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; font-size: 14.5px; }

.sp-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 8px; margin-top: 12px; }
.sp-imgs a { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 10px; border: 1px solid var(--line); background: #0d1119; }
.sp-imgs img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.sp-imgs a:hover img { transform: scale(1.04); }
.sp-files { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.sp-files a { display: flex; align-items: center; gap: 9px; padding: 8px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); min-width: 0; }
.sp-files a:hover { border-color: var(--accent); }
.sp-files .ico { flex: 0 0 auto; width: 17px; height: 17px; color: var(--accent); }
.sp-files span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 700; }
.sp-files small { flex: 0 0 auto; color: var(--muted); font-size: 12px; }

.sp-reply .flash, .sp-closed .flash, .auth .panel > .flash { margin: 0 0 14px; }
.sp-closed p { margin: 0; text-align: center; }
.sp-closed a { color: var(--accent); font-weight: 700; }
.menu-panel a .tab-badge { margin-left: auto; }

@media (max-width: 560px) {
  .support-page, .support-ticket { gap: 12px; }

  /* шапка запроса */
  .sp-head { flex-direction: column; align-items: stretch; gap: 14px; }
  .sp-head-main { flex: 0 0 auto; width: 100%; }
  .sp-head h1 { margin: 6px 0 10px; font-size: 21px; }
  .sp-meta { font-size: 12.5px; }
  .sp-top .button, .sp-actions, .sp-actions .button { width: 100%; justify-content: center; }

  /* переписка: аватарка слева от пузыря, а не отдельной строкой */
  .sp-thread { gap: 10px; }
  .sp-msg { flex-direction: row; align-items: flex-start; gap: 8px; }
  .sp-av .avatar.sm { width: 32px; height: 32px; margin-top: 2px; }
  .sp-av .avatar.letter { font-size: 13px; }
  .sp-bubble { flex: 1 1 0; width: auto; max-width: none; padding: 11px 12px 12px; border-radius: 14px; }
  .sp-bubble header { gap: 2px 8px; margin-bottom: 6px; }
  .sp-bubble time { margin-left: 0; width: 100%; order: 3; font-size: 11.5px; }
  .sp-body { font-size: 14px; line-height: 1.5; }
  .sp-imgs { grid-template-columns: repeat(auto-fill, minmax(min(100%, 110px), 1fr)); gap: 6px; margin-top: 10px; }
  .sp-files a { padding: 8px 10px; }

  /* форма ответа и новый запрос */
  .sp-reply, .support-page .panel { padding: 16px 14px; }
  .sp-reply textarea { min-height: 130px; }
  .sp-reply .button.wide { min-height: 46px; }

  /* список запросов */
  .sp-list li { flex-direction: column; align-items: flex-start; gap: 8px; }
}
.sp-list .sp-li-av { flex: 0 0 auto; margin-top: 2px; }
.sp-list li { justify-content: flex-start; }
.sp-list li .sub-main { flex: 1 1 auto; }
.sp-top .intro { text-align: left; margin: 0; }

@media (max-width: 380px) {
  .sp-av .avatar.sm { width: 28px; height: 28px; }
  .sp-msg { gap: 6px; }
  .sp-bubble { padding: 10px 11px 11px; }
}
