:root {
  --bg: #0d0f14;
  --panel: #161921;
  --panel-2: #1b1f29;
  --line: #262b37;
  --text: #eef0f5;
  --muted: #8d94a6;
  --accent: #f5a623;
  --accent-soft: rgba(245, 166, 35, .14);
  --danger: #e05a5a;
  --radius: 14px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); }

/* ---------- Шапка ---------- */
.topbar {
  background: rgba(15, 17, 22, .6);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
/* Те же границы, что у .container, чтобы меню и бренд совпадали с краями блоков */
.topbar-inner {
  max-width: 1340px; margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: #111; font-weight: 800;
}
.brand-mark { overflow: hidden; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand-name { font-weight: 800; font-size: 28px; letter-spacing: 1px; line-height: 1; }
.brand-name b { color: var(--accent); margin-left: 0; }

nav { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-left: auto; }
nav a, nav button {
  color: var(--muted); text-decoration: none; background: none; border: 0; cursor: pointer; font: inherit;
  padding: 7px 14px; border-radius: 999px;
}
nav a:hover, nav button:hover { color: var(--text); background: var(--panel-2); }
nav a.active { background: var(--accent); color: #111; font-weight: 600; }
nav button.btn { padding: 7px 14px; border-radius: 999px; color: var(--text); background: var(--panel-2); }

/* ---------- Контейнер и общие блоки ---------- */
.container { width: 100%; max-width: 1340px; margin: 0 auto; padding: 24px; flex: 1; }
h1 { margin: 0 0 8px; font-size: 28px; }
h2 { margin: 0; font-size: 18px; }
.muted { color: var(--muted); font-size: 13px; }
.panel-box {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
}
.block { margin-bottom: 20px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.panel-head a { font-size: 14px; text-decoration: none; }

/* ---------- Главная ---------- */
.hero {
  display: flex; gap: 32px; align-items: center; flex-wrap: wrap;
  background: linear-gradient(120deg, #1a1d26 0%, #12141a 100%);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 28px;
  margin-bottom: 20px;
}
.hero-logo {
  width: 260px; height: 260px; flex-shrink: 0; border-radius: 50%; overflow: hidden;
  background: #0f1116; border: 1px solid var(--line); display: grid; place-items: center;
}
.hero-logo img { width: 100%; height: 100%; object-fit: cover; }
.logo-placeholder { color: var(--muted); font-size: 14px; }
.hero-text { flex: 1; min-width: 260px; }
.kicker { color: var(--accent); font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; font-weight: 600; }
.hero-title { font-size: 56px; font-weight: 900; margin: 8px 0 14px; letter-spacing: 1px; line-height: 1.05; }
.hero-title span { color: var(--accent); text-shadow: 0 0 24px rgba(245, 166, 35, .35); }
.hero p { color: var(--muted); max-width: 620px; margin: 0 0 20px; }
.hero-btns { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
/* Кнопки шапки как на образце: первая — золотая с свечением, остальные — тёмные с рамкой */
.hero .btn {
  background: #1c2029; color: var(--text); border: 1px solid #3a3f4c;
  border-radius: 10px; padding: 11px 18px; font-size: 15px; font-weight: 600;
}
.hero .btn { gap: 8px; }
.hero .btn-ic { margin: 0; }
.hero .btn { transition: transform .15s ease, border-color .15s ease; }
.hero .btn:hover { border-color: var(--accent); transform: translateY(-3px); }
/* Третья кнопка темнее, близко к фону блока */
.hero .hero-btns .btn:nth-child(3) { background: #14171e; }
.hero .btn.primary {
  background: linear-gradient(90deg, #ffc857 0%, #f5a623 100%);
  color: #15171c; border-color: transparent;
  box-shadow: 0 0 22px rgba(245, 166, 35, .45);
}
.btn { display: inline-flex; align-items: center; gap: 8px; }
.btn-ic { width: 18px; height: 18px; flex-shrink: 0; }
@media (max-width: 640px) {
  .hero-logo { width: 100%; height: 200px; }
  .hero-title { font-size: 40px; }
}

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat {
  display: flex; align-items: center; gap: 16px;
  background: #171a22; border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px;
}
.stat-ic {
  width: 46px; height: 46px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0;
  background: rgba(245, 166, 35, .12); color: var(--accent);
}
.stat-ic svg { width: 22px; height: 22px; }
.stat-sub { color: var(--muted); font-size: 12px; }
a.stat { text-decoration: none; color: inherit; transition: transform .15s ease, border-color .15s ease; }
a.stat:hover { border-color: var(--accent); transform: translateY(-2px); }
.stat-num { font-size: 30px; font-weight: 900; line-height: 1.05; }
.stat-label { font-weight: 700; font-size: 15px; }

.home-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 860px) { .home-cols { grid-template-columns: 1fr; } }

/* Расписание */
.sched-list { display: flex; flex-direction: column; gap: 8px; }
.sched-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px;
}
.sched-row.today { border-color: var(--accent); background: rgba(245, 166, 35, .08); }
.day-badge {
  min-width: 40px; height: 34px; border-radius: 8px; display: grid; place-items: center;
  background: #232834; color: var(--muted); font-weight: 700; font-size: 13px;
}
.sched-row.today .day-badge { background: var(--accent); color: #111; }
.sched-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.sched-text b { font-size: 15px; }
.sched-text small { color: var(--muted); font-size: 12px; }
.today-tag {
  font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  background: var(--accent); color: #111; border-radius: 999px; padding: 3px 9px; white-space: nowrap;
}

/* Ссылки */
.links-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.link-wrap { display: flex; flex-direction: column; gap: 6px; }
.link-card {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-decoration: none; color: var(--text);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px;
}
.link-card { transition: transform .15s ease, border-color .15s ease; }
/* --lc задаётся для каждой ссылки отдельно; если не задан, берётся оранжевый */
.link-card:hover { border-color: var(--lc, var(--accent)); transform: translateY(-2px); }
.link-card:hover .link-arr { color: var(--lc, var(--accent)); }
.link-arr { width: 16px; height: 16px; margin-left: auto; flex-shrink: 0; color: var(--muted); }
.brand-badge {
  min-width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 12px; padding: 0 6px;
}
.link-text { display: flex; flex-direction: column; min-width: 0; }
.link-text b { font-size: 14px; }
/* Пояснение всегда в одну строку: что не влезает, заменяется многоточием */
.link-text small {
  color: var(--muted); font-size: 12px;
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.link-admin { display: flex; gap: 6px; }

/* Полоски оценок */
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 38px 1fr 56px; align-items: center; gap: 12px; }
.bar-key {
  height: 30px; border-radius: 7px; display: grid; place-items: center; font-weight: 800; color: #111;
}
.bar-track { height: 10px; background: #232834; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; }
.bar-count { text-align: right; font-weight: 700; color: var(--muted); }

/* ---------- Карточки ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.card {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; background: #232834; }
.card h3 { margin: 0; font-size: 15px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; white-space: pre-line; }
.card .actions { display: flex; gap: 8px; margin-top: auto; }

.tier-row {
  display: flex; gap: 12px; margin-bottom: 12px; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px;
}
.tier-label {
  min-width: 56px; display: grid; place-items: center; font-weight: 800; font-size: 22px; border-radius: 8px; color: #111;
}
.tier-items { display: flex; flex-wrap: wrap; gap: 10px; flex: 1; }
.tier-items .card { width: 200px; }

/* ---------- Кнопки и формы ---------- */
.btn {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 16px; cursor: pointer; font: inherit; text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn:hover { border-color: #3a4152; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.primary { background: var(--accent); color: #111; border-color: var(--accent); font-weight: 600; }
.btn.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
button:disabled { opacity: .6; cursor: default; }

form.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
  max-width: 420px; display: flex; flex-direction: column; gap: 12px;
}
input, textarea, select {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid #323846; background: #0f1116; color: var(--text); font: inherit;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.error { color: var(--danger); font-size: 14px; min-height: 1em; }
.empty { color: var(--muted); padding: 24px 0; margin: 0; }

dialog {
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; width: min(480px, 92vw);
}
dialog::backdrop { background: rgba(0, 0, 0, .65); }
dialog form { display: flex; flex-direction: column; gap: 12px; }
dialog h2 { margin: 0 0 4px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; }
fieldset.stat-fields {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 8px; margin: 0;
}
fieldset.stat-fields legend { color: var(--muted); padding: 0 6px; font-size: 13px; }
.stats-admin { margin: -8px 0 20px; text-align: right; }

.link-ic { background: rgba(245, 166, 35, .12); color: var(--accent); }
.link-ic svg { width: 20px; height: 20px; }
/* Квадрат иконки фиксированного размера: большая картинка внутри не меняет его размер */
.link-ic.brand-badge {
  width: 40px; height: 40px; min-width: 40px; max-width: 40px; flex-shrink: 0;
  padding: 0; overflow: hidden;
}
.link-img { width: 100%; height: 100%; max-width: 100%; object-fit: cover; display: block; }

/* Заголовок расписания: всё в одну строку */
.sched-head { margin-bottom: 8px; }
.sched-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sched-title h2 { font-size: 18px; }
.sched-ic { width: 24px; height: 24px; color: var(--accent); }
.sched-title .muted { font-size: 13px; }
.sched-meta { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.sched-tag {
  display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px;
}
.sched-tag svg { width: 18px; height: 18px; color: var(--accent); }
.row-tag { width: 15px; height: 15px; color: var(--accent); margin-right: 6px; vertical-align: -2px; }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
label.check input { width: auto; }

/* ---------- Страница «Просмотрено» ---------- */
.tl-head { margin-bottom: 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.tl-head-text { flex: 1; min-width: 260px; }
.tl-head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tl-title { font-size: 46px; font-weight: 900; margin: 6px 0 10px; letter-spacing: .5px; line-height: 1.05; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.tl-title .btn { font-size: 14px; font-weight: 600; }
.tl-desc { color: var(--muted); max-width: 640px; margin: 0; }

.tl-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 9px 16px; font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer;
  /* Размеры не меняются при выборе: одинаковая толщина шрифта и рамка во всех состояниях */
  transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
.chip b { color: var(--muted); font-weight: 700; margin-left: 2px; }
.chip:hover { border-color: #3a4152; }
.chip.active { background: var(--accent); border-color: var(--accent); color: #15171c; }
.chip.active b { color: #15171c; }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.tl-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.tl-search {
  position: relative; display: flex; align-items: center; flex: 0 1 320px;
}
/* Иконка выровнена по вертикали с текстом поля, а не по краю рамки */
.tl-search svg {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: var(--muted); pointer-events: none;
}
.tl-search input {
  padding-left: 37px; background: var(--panel-2); border-color: var(--line);
  line-height: 1.5;
}
.tl-search input::placeholder { color: var(--muted); }

/* Фильтр по оценкам: буква в цвете оценки, рамка того же цвета */
.tr-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tr-chip {
  min-width: 42px; height: 38px; padding: 0 10px;
  background: var(--panel-2); color: var(--tc, var(--accent));
  border: 1px solid var(--tc, var(--accent)); border-radius: 10px;
  font: inherit; font-size: 18px; font-weight: 800; cursor: pointer;
  transition: background-color .12s ease, color .12s ease;
}
.tr-chip:hover { background: color-mix(in srgb, var(--tc, var(--accent)) 18%, var(--panel-2)); }
.tr-chip.active { background: var(--tc, var(--accent)); color: #15171c; }
.tr-chip:focus-visible { outline: 2px solid var(--tc, var(--accent)); outline-offset: 2px; }

/* Строка тир-листа: цветной ярлык слева и постеры справа */
.tl-body { display: flex; flex-direction: column; gap: 14px; }
.tl-row {
  display: flex; gap: 0; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; align-items: stretch;
}
/* Блок оценки на всю высоту строки: левые углы скруглены по радиусу строки, правый край прямой */
.tl-label {
  width: 100px; min-width: 100px; align-self: stretch; border-radius: 13px 0 0 13px;
  background: var(--tc, #4a5165); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px; padding: 14px 8px;
}
.tl-key { font-size: 38px; font-weight: 900; line-height: 1; }
.tl-name { font-size: 15px; font-weight: 600; opacity: .9; }
.tl-count {
  margin-top: 6px; min-width: 24px; padding: 1px 7px; border-radius: 999px;
  background: rgba(0, 0, 0, .28); font-size: 12px; font-weight: 700; text-align: center;
}
/* Колонки одинаковой ширины: постеры центрируются в своей колонке, поэтому полная строка
   симметрична, а неполная стоит слева и не растягивается по всей ширине */
.tl-items {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  justify-items: center; align-content: start;
  gap: 10px; flex: 1; min-width: 0; padding: 10px;
}

/* Постеры */
.poster-wrap { position: relative; width: 105px; }
.poster {
  display: block; position: relative; width: 105px; height: 159px; border-radius: 8px;
  overflow: hidden; background: #232834; text-decoration: none; color: #fff;
  border: 1px solid var(--line); transition: transform .15s ease, border-color .15s ease;
}
.poster:hover { border-color: var(--accent); transform: translateY(-2px); }
.poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.poster-empty { display: block; width: 100%; height: 100%; }
/* Подложка с градиентом и отступами — на внешнем блоке */
.poster-title {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 8px 6px;
  background: linear-gradient(to top, rgba(0, 0, 0, .78) 58%, transparent);
  pointer-events: none;
}
/* Обрезка по строкам — на внутреннем: padding у line-clamp ломает подсчёт высоты */
.poster-title-in {
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12px; font-weight: 700; line-height: 16px;
  /* Жёсткая высота: ровно три строки */
  max-height: 48px;
}
/* Заметка при наведении на постер */
.poster-note {
  display: none; position: absolute; left: 50%; transform: translateX(-50%);
  bottom: calc(100% + 8px); width: 240px; z-index: 20;
  background: #0f1116; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; color: var(--muted); font-size: 13px; line-height: 1.4;
  white-space: pre-line; box-shadow: 0 10px 28px rgba(0, 0, 0, .5); pointer-events: none;
}
.poster-note b { display: block; color: var(--text); font-size: 14px; margin-bottom: 4px; }
.poster-wrap:hover { z-index: 10; }
.poster-wrap:hover .poster-note { display: block; }

.poster-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
/* Оценка на постере: список на всю ширину, над кнопками */
.tier-quick { flex-basis: 100%; width: 100%; padding: 3px 6px; font-size: 12px; border-radius: 6px; }
.poster-actions .btn { padding: 3px 7px; font-size: 11px; }
/* «Просмотр вне реакции»: обложка чёрно-белая, название остаётся читаемым */
.poster-bw img { filter: grayscale(1) contrast(1.05); }
/* Две оценки на карточке: ярлыки Эрика и Азизы в верхней части постера */
.pbadges {
  position: absolute; top: 6px; left: 6px; right: 6px; z-index: 1;
  display: flex; justify-content: space-between; gap: 4px; pointer-events: none;
}
.pbadge {
  flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between;
  padding: 2px 5px; border-radius: 6px; background: var(--tc); font-size: 12px; font-weight: 900; line-height: 1.2;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .45);
}
.pbadge small { font-size: 10px; font-weight: 700; opacity: .8; }

/* Режимы строк и два ряда фильтров оценок */
.mode-chips { margin-bottom: 10px; }

/* Подпись «Просмотрено вне реакции» поверх обложки, видна только при наведении */
.poster-bw-tag {
  display: none; position: absolute; top: 6px; left: 6px; right: 6px; z-index: 1;
  padding: 4px 6px; border-radius: 6px; background: rgba(0, 0, 0, .78); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 1.3; text-align: center; pointer-events: none;
}
.poster-wrap:hover .poster-bw-tag { display: block; }
/* Подпись по центру постера, чтобы не закрывать ярлыки оценок сверху */
.poster-bw-tag { top: 50%; transform: translateY(-50%); }
/* У таких карточек нет реакции: при наведении не подскакивает и не обводится */
.poster-bw:hover { transform: none; border-color: var(--line); }

@media (max-width: 640px) {
  .tl-title { font-size: 34px; }
  .tl-label { width: 92px; min-width: 92px; }
  .poster-wrap, .poster { width: 112px; }
  .poster { height: 158px; }
}

/* ---------- Страница «Очередь» ---------- */
/* Описание слева и блок ссылок справа одной высоты */
.q-top { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: stretch; margin-bottom: 20px; }
.q-intro { display: flex; flex-direction: column; justify-content: center; }
/* Блок заказа: яркий, компактный, ссылки в одну строку */
.q-links-box {
  align-self: center; display: flex; flex-direction: column; gap: 10px; padding: 16px 18px;
  background: linear-gradient(90deg, #ffc857 0%, #f5a623 100%); border-color: transparent; color: #15171c;
  box-shadow: 0 0 22px rgba(245, 166, 35, .35);
}
.q-links-box h2 { font-size: 16px; font-weight: 800; }
.q-links-box p { margin: 0; color: #15171c; opacity: .75; font-size: 13px; }
.q-links { display: flex; gap: 8px; }
.q-link {
  flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 12px; border-radius: 8px; background: #15171c; color: #ffc857;
  text-decoration: none; font-size: 14px; font-weight: 600;
  transition: transform .15s ease, opacity .15s ease;
}
.q-link:hover { transform: translateY(-1px); opacity: .85; }
.q-link.off { background: rgba(21, 23, 28, .22); color: #15171c; font-weight: 500; }
.q-link.off:hover { transform: none; opacity: 1; }
.q-arr { width: 14px; height: 14px; flex-shrink: 0; color: #ffc857; }
.q-links-box > .btn { align-self: flex-start; background: #15171c; color: #ffc857; border-color: #15171c; }
.q-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* Кнопки-категории под шапкой (пока только вид) */
.q-cats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
@media (max-width: 860px) { .q-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.q-cat {
  display: flex; align-items: center; gap: 12px; padding: 16px 18px;
  background: #171a22; border: 1px solid var(--line); border-radius: 14px;
  color: var(--text); font: inherit; font-size: 15px; font-weight: 600; text-align: left; cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}
.q-cat:hover { border-color: #3a4152; }
.q-cat.active { border-color: var(--accent); background: rgba(245, 166, 35, .08); }
.q-cat-ic {
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0;
  background: rgba(245, 166, 35, .12); color: var(--accent);
}
.q-cat-ic svg { width: 20px; height: 20px; }
.q-cat.active .q-cat-ic { background: var(--accent); color: #111; }

/* Блок одной очереди: отступ до следующего блока (аниме и фильмы не склеиваются) */
.q-block { margin-bottom: 20px; scroll-margin-top: 90px; }
.q-block:last-child { margin-bottom: 0; }

/* Блок одной очереди */
.q-block-head {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding-bottom: 16px; margin-bottom: 18px; border-bottom: 1px solid var(--line);
}
.q-block-title { display: flex; align-items: center; gap: 14px; }
.q-block-title h2 { font-size: 24px; font-weight: 800; }
.q-block-ic {
  width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent); color: #111;
}
.q-block-ic svg { width: 24px; height: 24px; }
.q-kpis { display: flex; gap: 10px; }
.q-kpi {
  min-width: 96px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: #171a22; border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px;
}
.q-kpi small { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; }
.q-kpi b { font-size: 24px; font-weight: 900; line-height: 1.1; }
.q-kpi-x { color: var(--accent); }

.q-mults-label {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 12px;
}
.q-mults { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 24px; }
@media (max-width: 860px) { .q-mults { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.q-mult {
  position: relative; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
.q-mult-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 10px; }
.q-x {
  background: rgba(245, 166, 35, .15); color: var(--accent); font-weight: 800; font-size: 12px;
  border-radius: 6px; padding: 3px 7px;
}
.q-range { font-weight: 700; font-size: 14px; }
.q-price { color: var(--muted); font-size: 13px; }
.q-mult.current { border-color: var(--accent); background: rgba(245, 166, 35, .08); }
.q-mult.current .q-x { background: var(--accent); color: #111; }
.q-mult.current .q-price { color: var(--text); }
.q-mult-tag {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #111; font-size: 10px; font-weight: 800; letter-spacing: .6px;
  text-transform: uppercase; border-radius: 999px; padding: 2px 9px; white-space: nowrap;
}

.q-list-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px;
  color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
}
.q-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.q-item {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px;
}
.q-num {
  min-width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0;
  background: #232834; color: var(--muted); font-weight: 700; font-size: 13px;
}
.q-item-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.q-item-text b { font-size: 15px; }
.q-item-text b a { color: var(--text); text-decoration: none; }
.q-item-text b a:hover { color: var(--accent); }
.q-item-text small { color: var(--muted); font-size: 13px; white-space: pre-line; }
.q-item-actions { display: flex; gap: 6px; }
/* Заказавший: круглая аватарка и имя в одной строке */
.q-by { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.q-avatar {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; background: rgba(245, 166, 35, .15); color: var(--accent);
}
.q-avatar svg { width: 12px; height: 12px; }

@media (max-width: 860px) {
  .q-top { grid-template-columns: 1fr; }
}

/* Очередь на главной: заголовок с числом над постерами */
.home-q-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.home-q-head h3 { margin: 0; font-size: 17px; }
.home-q-count {
  min-width: 26px; padding: 2px 8px; border-radius: 6px; text-align: center;
  background: var(--accent); color: #15171c; font-weight: 800; font-size: 13px;
}
/* Блок растягивается по высоте расписания; две строки делят её поровну */
.home-queue { display: flex; flex-direction: column; }
.home-queue .tl-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 14px; }
.home-q { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
/* Постеры по высоте строки; ширина считается от пропорций 105:159 */
.home-q .tl-items {
  flex: 1 1 0; min-height: 0; padding: 0; display: flex; flex-wrap: nowrap; gap: 10px;
  align-items: stretch; justify-items: start; overflow-x: auto; overflow-y: hidden;
  /* Полосу прокрутки прячем: при наведении заметка может выходить за край строки */
  scrollbar-width: none;
}
.home-q .tl-items::-webkit-scrollbar { display: none; }
.home-q .poster-wrap { height: 100%; width: auto; aspect-ratio: 105 / 159; flex-shrink: 0; }
.home-q .poster { width: 100%; height: 100%; }
/* На главной при наведении ничего не меняется: без подъёма, подсветки и заметки */
.home-q .poster:hover { transform: none; border-color: var(--line); }
.home-q .poster-wrap:hover { z-index: auto; }
.home-q .poster-wrap:hover .poster-note { display: none; }
/* В режиме админки под постером кнопки: оставляем им место внизу */
.home-q.admin .poster { height: calc(100% - 30px); }

/* Метка роли в шапке: видна только суперадмину */
.role-badge {
  align-self: center; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent);
}

/* ---------- Вход в админку: карточка по центру страницы ---------- */
.login-wrap { min-height: 60vh; display: flex; align-items: center; justify-content: center; }
.login-card {
  width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  padding: 32px 28px; text-align: center; box-shadow: 0 20px 50px rgba(0, 0, 0, .4);
}
.login-card h2 { font-size: 22px; margin: 4px 0 0; }
.login-card p { margin: 0; }
.login-card label { text-align: left; }
.login-card .error { text-align: center; }
.login-shield {
  width: 68px; height: 68px; margin: 0 auto; border-radius: 50%;
  display: grid; place-items: center; background: rgba(245, 166, 35, .12); color: var(--accent);
}
.login-shield svg { width: 34px; height: 34px; }
.login-btn { width: 100%; padding: 11px; font-size: 15px; }

/* ---------- Подвал ---------- */
/* Нижний колонтитул: ширина как у сайта, слева две строки, справа ссылки из админки */
.footer {
  border-top: 1px solid var(--line); padding: 18px 0; color: #4f5566; font-size: 13px;
}
.footer-inner {
  max-width: 1340px; margin: 0 auto; padding: 0 24px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap;
}
.footer-left { display: flex; flex-direction: column; gap: 4px; }
/* Ссылки такого же цвета, как обычный текст подвала; при наведении — тёмно-жёлтый, без подчёркивания */
.footer a { color: #4f5566; text-decoration: none; }
.footer a:hover { color: #b8860b; text-decoration: none; }
.footer-right { display: flex; align-items: flex-start; }
.footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.footer .sep { color: #4f5566; }
.footer-links .btn { margin-left: 4px; }
