
:root {
  --bg: #0e0e0e; --bg-2: #161616; --bg-3: #1e1e1e; --bg-4: #252525;
  --border: #2a2a2a; --border-2: #333;
  --text: #f0f0f0; --text-2: #a0a0a0; --text-3: #6a6a6a;
  --red: #e03030; --red-2: #b82626; --red-3: #ff5050;
  --green: #2fb86b; --yellow: #e8b54a; --orange: #e88a3a; --gold: #d4af37;
  --accent-red: #E24B4A;
  --status-viewed-list: #6E9A52;
  --status-viewed-tile: #8FBF6A;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { background: var(--bg); color: var(--text); font-family: 'Manrope', sans-serif; font-size: 14px; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; }

.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: var(--bg-2); border-right: 1px solid var(--border); padding: 24px 0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { padding: 0 24px 24px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.brand-logo { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.brand-logo span { color: var(--red); }
.brand-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; text-transform: uppercase; letter-spacing: 1px; }

/* ---------- Сайдбар: переключатель продукта (дропдаун) ---------- */
.sidebar-product-switch { position: relative; padding: 0 24px 20px; }
.sidebar-product-switch-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); margin-bottom: 6px; }
.sidebar-product-switch-btn { display: flex; align-items: center; gap: 8px; width: 100%; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; }
.sidebar-product-switch-btn:hover { border-color: var(--border-2); }
.sidebar-product-switch-static { display: flex; align-items: center; gap: 8px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; color: var(--text); font-size: 13px; font-weight: 600; }
.sidebar-product-switch-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.sidebar-product-switch-chevron { color: var(--text-3); flex-shrink: 0; }
.sidebar-product-switch-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.sidebar-product-switch-menu { display: none; position: absolute; top: 100%; left: 24px; right: 24px; margin-top: 4px; background: var(--bg-3); border: 1px solid var(--border); border-radius: 8px; padding: 4px; z-index: 30; box-shadow: 0 8px 24px rgba(0,0,0,0.35); }
.sidebar-product-switch-menu.show { display: block; }
.sidebar-product-switch-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 6px; font-size: 13px; color: var(--text-2); border-left: 2px solid transparent; }
.sidebar-product-switch-item:hover { background: var(--bg-4); color: var(--text); }
.sidebar-product-switch-item.active { border-left-color: #DA1B2E; background: rgba(218,27,46,0.1); color: var(--text); }

.nav { flex: 1; padding: 0 12px; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 8px; color: var(--text-2); cursor: pointer; margin-bottom: 2px; font-weight: 500; font-size: 13.5px; position: relative; }
.nav-item:hover { background: var(--bg-3); color: var(--text); }
.nav-item.active { background: var(--bg-3); color: var(--text); }
.nav-item.active::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; background: var(--red); border-radius: 0 3px 3px 0; }
.nav-icon { width: 18px; height: 18px; opacity: 0.85; flex-shrink: 0; }
.nav-badge { margin-left: auto; background: var(--red); color: #fff; font-size: 10px; padding: 2px 7px; border-radius: 10px; font-weight: 700; }

.support-block { padding: 12px 12px 0; border-top: 1px solid var(--border); margin-top: 8px; }
.support-block-inner { border-left: 2px solid rgba(218,27,46,0.25); padding-left: 10px; display: flex; flex-direction: column; gap: 2px; }
.support-btn { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-radius: 6px; background: none; color: var(--text-3); font-weight: 400; font-size: 13px; text-decoration: none; }
.support-btn:hover { color: var(--text-2); background: none; }

.user-block { padding: 16px; border-top: 1px solid var(--border); display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--red), var(--red-2)); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; overflow: hidden; }
.user-info { flex: 1; min-width: 0; }
.user-name { font-weight: 600; font-size: 13px; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.user-tariff { font-size: 11px; color: var(--text-3); }

.main { padding: 32px 40px; max-width: 1200px; position: relative; min-width: 0; }
.page { display: none; }
.page.active { display: block; }
.page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 28px; gap: 16px; }
.page-title { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; }
.page-sub { color: var(--text-2); margin-top: 4px; font-size: 13.5px; }

.card { background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 22px; }
.card-title { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 14px; font-weight: 600; }

.greeting-title { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.home-greeting { font-size: 18px; font-weight: 500; color: var(--text); margin-bottom: 20px; padding-right: 64px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cardinal-card { background: linear-gradient(135deg, #1a0d0d 0%, var(--bg-2) 100%); border: 1px solid #3a1818; border-radius: 14px; padding: 24px; margin-bottom: 20px; display: grid; grid-template-columns: 160px 1fr; gap: 24px; align-items: center; position: relative; overflow: hidden; }
.cardinal-card::before { content: ''; position: absolute; top: -50%; right: -10%; width: 300px; height: 300px; background: radial-gradient(circle, rgba(224,48,48,0.08) 0%, transparent 70%); pointer-events: none; }
.cardinal-visual { display: flex; align-items: center; justify-content: center; height: 140px; position: relative; z-index: 1; }
.cardinal-info { position: relative; z-index: 1; }
.cardinal-stage-label { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.8px; font-weight: 600; margin-bottom: 6px; }
.cardinal-stage { font-size: 22px; font-weight: 800; letter-spacing: -0.3px; margin-bottom: 4px; }
.cardinal-meta { font-size: 13px; color: var(--text-2); margin-bottom: 14px; }
.cardinal-progress { background: var(--bg-3); border-radius: 6px; height: 8px; overflow: hidden; margin-bottom: 8px; }
.cardinal-progress-fill { height: 100%; background: linear-gradient(90deg, var(--red), var(--red-3)); border-radius: 6px; }

.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.stat-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.stat-label { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 10px; font-weight: 600; }
.stat-value { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.stat-sub { font-size: 12px; color: var(--text-2); }
.stat-sub.green { color: var(--green); }

.next-event { background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 20px; display: flex; gap: 18px; align-items: center; }
.event-date { background: var(--bg-3); border-radius: 10px; padding: 12px 14px; text-align: center; min-width: 64px; }
.event-day { font-size: 22px; font-weight: 700; line-height: 1; }
.event-month { font-size: 11px; color: var(--text-2); text-transform: uppercase; margin-top: 4px; }
.event-info { flex: 1; }
.event-title { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.event-meta { font-size: 12.5px; color: var(--text-2); }
.event-cta { background: var(--red); color: #fff; padding: 9px 18px; border-radius: 8px; font-weight: 600; font-size: 13px; }
.event-cta:hover { background: var(--red-2); }

.section-title { font-size: 16px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.section-title .badge { background: var(--red); color: #fff; font-size: 10px; padding: 2px 8px; border-radius: 10px; font-weight: 700; }

.new-list { display: flex; flex-direction: column; gap: 8px; }
.new-item { display: flex; gap: 14px; padding: 14px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; align-items: center; cursor: pointer; }
.new-item:hover { border-color: var(--border-2); }
.new-icon { width: 40px; height: 40px; border-radius: 8px; background: var(--bg-3); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.new-content { flex: 1; }
.new-title { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.new-meta { font-size: 12px; color: var(--text-3); }
.new-tag { font-size: 10px; padding: 3px 8px; border-radius: 6px; background: var(--red); color: #fff; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }

.content-tabs { display: flex; gap: 28px; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.content-tab { display: flex; align-items: center; gap: 8px; padding: 0 0 14px; font-size: 15px; font-weight: 600; color: var(--text-3); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.content-tab svg { width: 18px; height: 18px; }
.content-tab:hover { color: var(--text-2); }
.content-tab.active { color: var(--text); border-bottom-color: var(--red); }

.content-toolbar { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; align-items: center; }
.search-input { flex: 1; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; color: var(--text); font-size: 13.5px; outline: none; }
.search-input:focus { border-color: var(--border-2); }
.filter-tabs { display: flex; gap: 4px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 4px; }
.filter-tab { padding: 4px 10px; border-radius: 6px; font-size: 12px; color: var(--text-2); font-weight: 500; cursor: pointer; }
.filter-tab.active { background: var(--bg-4); color: var(--text); }

.content-view-toggle { display: flex; gap: 4px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 4px; flex-shrink: 0; }
.view-toggle-btn { width: 30px; height: 26px; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: var(--text-3); cursor: pointer; }
.view-toggle-btn svg { width: 16px; height: 16px; }
.view-toggle-btn:hover { color: var(--text-2); }
.view-toggle-btn.active { background: var(--bg-4); color: var(--red); }

.content-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.video-card { display: flex; flex-direction: column; background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; cursor: pointer; }
.video-card:hover { border-color: var(--border-2); }
.video-thumb { aspect-ratio: 16/9; background: linear-gradient(135deg, var(--bg-3), var(--bg-4)); position: relative; display: flex; align-items: center; justify-content: center; }
.video-play { width: 50px; height: 50px; border-radius: 50%; background: rgba(224, 48, 48, 0.95); display: flex; align-items: center; justify-content: center; }
.video-duration { position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,0.75); padding: 3px 7px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.video-watched { position: absolute; top: 8px; right: 8px; background: var(--green); width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; }
/* Список эфиров (плитка) — приглушённая версия того же индикатора; своя
   отдельная от .video-watched (используется и на главной, home.html). */
.video-tile-watched {
  position: absolute; top: 8px; right: 8px;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(30, 30, 30, 0.85);
  display: flex; align-items: center; justify-content: center;
}
.video-tile-watched .ti { font-size: 13px; color: var(--status-viewed-tile); }
.video-info { padding: 14px; }
.video-title { font-weight: 600; font-size: 14px; margin-bottom: 6px; line-height: 1.35; }
.video-meta { font-size: 11.5px; color: var(--text-3); display: flex; gap: 10px; align-items: center; }
.video-chat-link { color: var(--red); font-weight: 600; }

/* ===== Пилюли тегов в списке эфиров — общий блок для плитки и строки
   (app/templates/platform/_tag_pills.html), без переноса на вторую строку. ===== */
.tag-pill-row { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; overflow: hidden; min-width: 0; }
.tag-pill-row .tag-pill { cursor: pointer; flex-shrink: 0; }
.tag-pill-row-grid { min-height: 24px; margin: 10px 0; }
.tag-pill-row-list { margin-top: 8px; }
.tag-pill-count {
  display: inline-flex; align-items: center; flex-shrink: 0;
  font-size: 11px; padding: 4px 10px; border-radius: 20px;
  background: transparent; border: 0.5px solid #2E2E2E; color: #8A8A8A;
  white-space: nowrap;
}

.content-list { display: none; flex-direction: column; }
html.sta-view-list #content-view-grid { display: none; }
html.sta-view-list #content-view-list { display: flex; }
.video-row { display: flex; align-items: center; gap: 14px; padding: 12px 6px; border-bottom: 1px solid var(--border); cursor: pointer; text-decoration: none; color: inherit; min-width: 0; }
.video-row:last-child { border-bottom: none; }
.video-row:hover { background: var(--bg-2); }
.video-row-thumb { width: 80px; height: 50px; flex-shrink: 0; border-radius: 6px; background: linear-gradient(135deg, var(--bg-3), var(--bg-4)); }
.video-row-info { flex: 1; min-width: 0; }
.video-row-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; line-height: 1.35; word-break: break-word; overflow-wrap: anywhere; }
.video-row-meta { font-size: 12px; color: var(--text-3); }
.video-row-meta-sep { color: #4A4A4A; }
.video-row-watched-meta { display: inline-flex; align-items: center; gap: 5px; color: var(--status-viewed-list); }
.video-row-watched-meta .ti { font-size: 14px; }
.video-row-tags { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; max-width: 220px; justify-content: flex-end; }
.video-row-watched-wrap { width: 22px; flex-shrink: 0; }

.calendar { background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.cal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.cal-month { font-size: 17px; font-weight: 700; }
.cal-nav { display: flex; gap: 6px; }
.cal-nav button { width: 32px; height: 32px; border-radius: 6px; background: var(--bg-3); display: flex; align-items: center; justify-content: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-day-name { text-align: center; font-size: 11px; color: var(--text-3); padding: 8px 0; text-transform: uppercase; font-weight: 600; }
.cal-day { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 8px; cursor: pointer; font-size: 13px; position: relative; }
.cal-day:hover { background: var(--bg-3); }
.cal-day.other-month { color: var(--text-3); opacity: 0.4; }
.cal-day.today { background: var(--red); color: #fff; font-weight: 700; }
.cal-day.has-event::after { content: ''; position: absolute; bottom: 6px; width: 5px; height: 5px; background: var(--red); border-radius: 50%; }
.cal-day.today.has-event::after { background: #fff; }

.events-upcoming { margin-top: 24px; }
.event-row { display: flex; gap: 16px; padding: 14px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; align-items: center; }
.event-row .event-date { min-width: 60px; padding: 10px 12px; }
.event-actions { display: flex; gap: 8px; }
.btn-sm { padding: 7px 14px; border-radius: 7px; font-size: 12px; font-weight: 600; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-2); }
.btn-ghost { background: var(--bg-3); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-4); }

.community-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.community-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 24px; text-align: center; }
.community-icon { width: 56px; height: 56px; border-radius: 14px; background: var(--bg-3); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px; font-size: 26px; }
.community-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.community-card p { font-size: 13px; color: var(--text-2); margin-bottom: 16px; line-height: 1.5; }
.btn-block { display: block; width: 100%; padding: 11px; border-radius: 8px; font-weight: 600; font-size: 13.5px; }
.community-info { background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 18px; margin-top: 16px; display: flex; gap: 12px; }
.info-icon { font-size: 18px; flex-shrink: 0; }
.info-text { font-size: 13px; color: var(--text-2); line-height: 1.5; }

.community-grid-secondary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 12px; }
.community-card-small { display: flex; align-items: center; gap: 10px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; opacity: 0.85; }
.community-icon-small { color: var(--text-3); flex-shrink: 0; display: flex; align-items: center; }
.community-card-small-body { flex: 1; min-width: 0; }
.community-card-small-body h4 { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.community-card-small-body p { font-size: 11px; color: var(--text-3); line-height: 1.35; }
.community-card-small-btn { display: inline-block; flex-shrink: 0; width: auto; padding: 6px 16px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; background: transparent; border: 1px solid var(--border); color: var(--text-2); }
.community-card-small-btn:hover { background: var(--bg-3); }

/* Фотогалерея (раздел «Сообщество») */
.gallery-divider { border: none; border-top: 1px solid var(--border); margin: 32px 0 24px; }
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.gallery-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.gallery-card-photos { aspect-ratio: 16/10; background: var(--bg-3); }
.gallery-photos-1 { width: 100%; height: 100%; }
.gallery-photos-1 img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-photos-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px; width: 100%; height: 100%; }
.gallery-photos-2 img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-photos-3 { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: repeat(2, 1fr); gap: 2px; width: 100%; height: 100%; }
.gallery-photos-3 img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-photos-3 img:first-child { grid-row: 1 / 3; }
.gallery-card-body { padding: 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.gallery-card-title { font-size: 15px; font-weight: 700; line-height: 1.3; }
.gallery-card-date { font-size: 12.5px; color: var(--text-2); margin-bottom: 8px; }
.gallery-card-btn { margin-top: auto; }

/* Планшет: 2 колонки — брейкпоинт добавлен специально для галереи (в остальной вёрстке
   платформы переход идёт сразу десктоп → мобиль на 760px, промежуточного шага не было) */
@media (max-width: 1024px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field-label { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.8px; font-weight: 600; }
.field-input { background: var(--bg-3); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; color: var(--text); font-size: 13.5px; outline: none; }
.field-input:focus { border-color: var(--border-2); }
textarea.field-input { resize: vertical; min-height: 80px; }
.field-input-readonly { background: var(--bg-2); border: 1px solid transparent; color: var(--text-3); cursor: default; }

/* Убрать спиннер-стрелки у числовых полей */
input[type="number"].no-spin::-webkit-inner-spin-button,
input[type="number"].no-spin::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"].no-spin { -moz-appearance: textfield; }

.avatar-upload { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.avatar-big { width: 72px; height: 72px; border-radius: 50%; background: linear-gradient(135deg, var(--red), var(--red-2)); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 26px; flex-shrink: 0; }
.avatar-actions { flex: 1; }
.avatar-actions .btn-row { display: flex; gap: 8px; margin-top: 8px; }
.avatar-tg-hint { font-size: 11.5px; color: var(--text-3); margin-top: 6px; }

.tariff-card { background: linear-gradient(135deg, var(--bg-3), var(--bg-2)); border: 1px solid var(--border-2); border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.tariff-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.tariff-name { font-size: 16px; font-weight: 700; }
.tariff-status { font-size: 11px; padding: 3px 9px; border-radius: 10px; background: rgba(47, 184, 107, 0.15); color: var(--green); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.tariff-price { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.tariff-price span { font-size: 13px; color: var(--text-2); font-weight: 500; }
.tariff-next { font-size: 12.5px; color: var(--text-2); }

.toggle-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
.toggle-row:last-child { border-bottom: none; }
.toggle-label { font-size: 13.5px; font-weight: 500; }
.toggle-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.toggle { width: 40px; height: 22px; background: var(--bg-4); border-radius: 11px; position: relative; cursor: pointer; }
.toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--text); transition: left 0.15s; }
.toggle.on { background: var(--red); }
.toggle.on::after { left: 20px; background: #fff; }

.btn-danger-ghost { color: var(--red); background: transparent; border: 1px solid var(--red); padding: 10px 16px; border-radius: 8px; font-weight: 600; font-size: 13px; }
.btn-danger-ghost:hover { background: rgba(224, 48, 48, 0.1); }

.achievements { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.achievement { background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 14px 10px; text-align: center; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.achievement.unlocked { background: linear-gradient(135deg, var(--bg-2), #1a1610); }
.achievement.unlocked:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35); }
.achievement-icon { font-size: 28px; margin-bottom: 6px; display: flex; align-items: center; justify-content: center; }
.achievement-name { font-size: 11px; font-weight: 700; margin-bottom: 2px; line-height: 1.2; }
.achievement-desc { font-size: 10px; color: var(--text-3); line-height: 1.3; }

.wins-list { display: flex; flex-direction: column; gap: 8px; }
.win-item { background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 14px; display: flex; gap: 12px; align-items: flex-start; }
.win-icon { width: 36px; height: 36px; border-radius: 8px; background: var(--bg-3); display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.win-body { flex: 1; }
.win-title { font-weight: 600; font-size: 13.5px; margin-bottom: 3px; }
.win-meta { font-size: 11.5px; color: var(--text-3); margin-bottom: 6px; }
.win-text { font-size: 13px; color: var(--text-2); line-height: 1.4; }
.win-tag { display: inline-block; font-size: 10px; padding: 2px 7px; border-radius: 5px; background: rgba(47,184,107,0.15); color: var(--green); font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; margin-top: 6px; }
.btn-add { background: var(--red); color: #fff; padding: 10px 16px; border-radius: 8px; font-weight: 600; font-size: 13px; }
.btn-add:hover { background: var(--red-2); }

.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: none; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal-bg.show { display: flex; }
.modal { background: var(--bg-2); border: 1px solid var(--border-2); border-radius: 14px; padding: 28px; width: 480px; max-width: 100%; max-height: 90vh; overflow-y: auto; }
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.modal-sub { font-size: 13px; color: var(--text-2); margin-bottom: 20px; }
.modal-actions { display: flex; gap: 8px; margin-top: 20px; justify-content: flex-end; }
.avatar-crop-wrap { max-height: 60vh; margin: 4px 0 0; overflow: hidden; }
.avatar-crop-wrap img { display: block; max-width: 100%; }
.avatar-crop-wrap .cropper-view-box,
.avatar-crop-wrap .cropper-face { border-radius: 50%; }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; padding: 14px; background: var(--bg-3); border-radius: 8px; margin-top: 14px; cursor: pointer; }
.checkbox { width: 18px; height: 18px; border: 2px solid var(--border-2); border-radius: 4px; flex-shrink: 0; margin-top: 1px; display: flex; align-items: center; justify-content: center; }
.checkbox.on { background: var(--red); border-color: var(--red); }
.checkbox.on::after { content: '✓'; color: #fff; font-size: 12px; font-weight: 700; }
.checkbox-text { font-size: 12.5px; color: var(--text-2); line-height: 1.45; }
.radio { width: 18px; height: 18px; border: 2px solid var(--border-2); border-radius: 50%; flex-shrink: 0; margin-top: 1px; display: flex; align-items: center; justify-content: center; }
.radio.on { border-color: var(--red); }
.radio.on::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.onboarding-wrap { max-width: 480px; margin: 60px auto; padding: 0 20px; }
.onboarding-suggest { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; margin-top: 4px; max-height: 220px; overflow-y: auto; z-index: 5; }
.onboarding-suggest-item { padding: 10px 14px; cursor: pointer; font-size: 13px; }
.onboarding-suggest-item:hover { background: var(--bg-3); }

.notif-list { display: flex; flex-direction: column; gap: 8px; }
.notif-item { display: flex; gap: 14px; padding: 16px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; align-items: flex-start; }
.notif-item.unread { border-left: 3px solid var(--red); }
.notif-icon { width: 36px; height: 36px; border-radius: 8px; background: var(--bg-3); display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.notif-body { flex: 1; }
.notif-title { font-weight: 600; font-size: 13.5px; margin-bottom: 4px; }
.notif-text { font-size: 12.5px; color: var(--text-2); line-height: 1.45; }
.notif-time { font-size: 11px; color: var(--text-3); margin-top: 6px; }
.cardinal-svg { width: 100%; height: 100%; }
/* Расписание 2 колонки */
.schedule-layout { display: grid; grid-template-columns: 440px 1fr; gap: 20px; align-items: flex-start; }
.calendar-compact { padding: 16px; }
.calendar-compact .cal-header { margin-bottom: 12px; }
.calendar-compact .cal-month { font-size: 15px; }
.calendar-compact .cal-day-name { font-size: 10px; padding: 6px 0; }
.calendar-compact .cal-grid { gap: 2px; }
.calendar-compact .cal-day { aspect-ratio: 1; border-radius: 6px; font-size: 12px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 4px; gap: 1px; position: relative; }
.calendar-compact .cal-day.has-event::after { display: none; }
.cal-day-num { font-size: 12px; font-weight: 600; line-height: 1; }
.cal-day-label { font-size: 8.5px; line-height: 1.05; color: var(--text-3); text-align: center; padding: 0 2px; font-weight: 500; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-compact .cal-day.today .cal-day-num { color: #fff; }
.calendar-compact .cal-day.today .cal-day-label { color: rgba(255,255,255,0.85); }
.calendar-compact .cal-day-dots { display: flex; gap: 2px; margin-top: 1px; }
.cal-dot { width: 4px; height: 4px; border-radius: 50%; }
.cal-dot.red { background: var(--red); }
.cal-dot.blue { background: #4a90d9; }
.cal-dot.green { background: var(--green); }
.cal-dot.gold { background: var(--gold); }

/* Легенда */
.cal-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-2); }

/* Правая колонка — список событий */
.events-column { display: flex; flex-direction: column; gap: 8px; }
.events-column .event-row { margin-bottom: 0; }
.events-column .event-type-tag { font-size: 10px; padding: 2px 7px; border-radius: 5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 6px; display: inline-block; }
.tag-regular { background: rgba(224,48,48,0.15); color: var(--red); }
.tag-offline { background: rgba(212,175,55,0.15); color: var(--gold); }
.tag-task { background: rgba(74,144,217,0.15); color: #6aa8e0; }
.tag-guest { background: rgba(47,184,107,0.15); color: var(--green); }

/* Дропдаун «+ В календарь» */
.cal-add-dropdown { position: relative; display: inline-block; }
.cal-add-menu { display: none; position: absolute; top: calc(100% + 4px); right: 0; background: var(--bg-3); border: 1px solid var(--border); border-radius: 8px; padding: 6px; min-width: 180px; z-index: 20; box-shadow: 0 8px 24px rgba(0,0,0,0.35); }
.cal-add-menu.show { display: block; }
.cal-add-menu a { display: block; padding: 8px 10px; border-radius: 6px; font-size: 13px; color: var(--text); }
.cal-add-menu a:hover { background: var(--bg-4); }

/* Направления */
.dir-filters { display: flex; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.dir-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dir-group-label { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.6px; font-weight: 700; margin-right: 4px; }
/* БЗ: единый поток направлений без подписей групп (группировка — по цвету) */
.dir-filters.kb-type-filters { margin-bottom: 12px; }
.dir-group.dir-group-flow { gap: 8px; }
.dir-chip { padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; background: var(--bg-2); border: 1px solid var(--border); color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.dir-chip:hover { border-color: var(--border-2); color: var(--text); }
.dir-chip.active { background: var(--red); border-color: var(--red); color: #fff; }

/* ===== Единая пилюля тега (app/core/taxonomy.py — источник цвета/иконки) =====
   Радиус/паддинг/шрифт — по спецификации платформенного тегирования, цвет
   заливки — только через --pill-bg/--pill-text/--pill-accent, выставленные
   инлайново из Jinja конкретными hex из справочника (без хардкода в CSS). */
.tag-pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; padding: 5px 12px; border-radius: 20px;
  background: transparent; color: #C8C8C8; border: 0.5px solid #2E2E2E;
  text-decoration: none; white-space: nowrap;
  transition: border-color 0.15s ease;
}
.tag-pill-icon { width: 14px; height: 14px; flex-shrink: 0; font-size: 14px; color: var(--pill-accent, #8A8A8A); }
.tag-pill.selected { background: var(--pill-bg); color: var(--pill-text); border-color: var(--pill-bg); }
.tag-pill.selected .tag-pill-icon { color: var(--pill-text); }
a.tag-pill { cursor: pointer; }
@media (hover: hover) {
  .tag-pill:not(.selected):hover { border-color: var(--pill-accent, #4A4A4A); }
}
.tag-pill:not(.selected):active { border-color: var(--pill-accent, #4A4A4A); }
@media (prefers-reduced-motion: reduce) {
  .tag-pill { transition: none; }
}
/* Уменьшенный размер — теги в строке/плитке эфира (список, не деталка) */
.tag-pill-sm { font-size: 11px; padding: 4px 10px; gap: 6px; }
.tag-pill-sm .tag-pill-icon { width: 13px; height: 13px; font-size: 13px; }

/* Ярлык типа объекта — «ЭФИР», брендовый красный, не кликается */
.video-type-label {
  display: inline-flex; align-items: center;
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  border-radius: 4px; padding: 4px 8px;
  color: #E24B4A; border: 0.5px solid #E24B4A;
}

/* Чип фильтра «Тип материала» — у типа нет цвета по замыслу справочника,
   только иконка (resting/active — те же константы, что и в CRM). */
.type-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; padding: 4px 10px; border-radius: 20px;
  background: transparent; color: #C8C8C8; border: 0.5px solid #2E2E2E;
  text-decoration: none; white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.type-chip-icon { width: 14px; height: 14px; flex-shrink: 0; font-size: 14px; color: #8A8A8A; }
.type-chip.active { background: #2C2C2A; border-color: #3A3A3A; color: #F2F2F2; }
.type-chip.active .type-chip-icon { color: #E8E8E8; }
/* «Все» — как везде на платформе, красной заливкой, а не нейтральной */
.type-chip-all.active { background: var(--red); border-color: var(--red); color: #fff; }
@media (hover: hover) {
  .type-chip:not(.active):hover { border-color: #4A4A4A; }
}
.type-chip:not(.active):active { border-color: #4A4A4A; }

/* База знаний */
.kb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.kb-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 18px; cursor: pointer; display: flex; flex-direction: column; gap: 10px; }
.kb-card:hover { border-color: var(--border-2); }
.kb-icon { width: 40px; height: 40px; flex-shrink: 0; border-radius: 9px; background: #1A1A1A; display: flex; align-items: center; justify-content: center; font-size: 20px; color: #9A9A9A; }
.kb-title { font-weight: 600; font-size: 14px; line-height: 1.35; }
.kb-desc { font-size: 12.5px; color: var(--text-2); line-height: 1.45; }
.kb-meta { display: flex; gap: 10px; font-size: 12px; color: #7A7A7A; align-items: center; margin-top: auto; flex-wrap: wrap; }
.kb-meta-dir { display: inline-flex; align-items: center; gap: 6px; }
.kb-meta-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.kb-tag { padding: 2px 7px; border-radius: 4px; background: var(--bg-3); color: var(--text-2); font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; font-size: 10px; }
.kb-row { display: flex; align-items: center; gap: 14px; padding: 12px 6px; border-bottom: 1px solid var(--border); cursor: pointer; }
.kb-row:last-child { border-bottom: none; }
.kb-row:hover { background: var(--bg-2); }
.kb-row-icon { width: 40px; height: 40px; flex-shrink: 0; border-radius: 9px; background: #1A1A1A; display: flex; align-items: center; justify-content: center; font-size: 20px; color: #9A9A9A; }
.kb-modal-img { width: 100%; max-height: 320px; object-fit: cover; border-radius: 10px; margin-bottom: 16px; display: block; }
.kb-modal-body { font-size: 13.5px; line-height: 1.6; color: var(--text-2); white-space: pre-line; margin: 6px 0 20px; }

/* Блок практики под эфиром */
.practice-block { background: linear-gradient(135deg, rgba(224,48,48,0.08), var(--bg-2)); border: 1px solid rgba(224,48,48,0.25); border-radius: 12px; padding: 20px; margin: 20px 0; }
.practice-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.practice-icon-small { width: 32px; height: 32px; border-radius: 8px; background: var(--red); display: flex; align-items: center; justify-content: center; font-size: 16px; }
.practice-title { font-weight: 700; font-size: 15px; }
.practice-text { font-size: 13.5px; color: var(--text-2); line-height: 1.55; margin-bottom: 12px; }
.practice-done-btn { background: var(--bg-3); border: 1px solid var(--border); color: var(--text); padding: 8px 14px; border-radius: 8px; font-weight: 600; font-size: 12.5px; }
.practice-done-btn.done { background: rgba(47,184,107,0.12); border-color: var(--green); color: var(--green); }
.practice-done-btn.done::before { content: '✓ '; }

.video-page { display: grid; grid-template-columns: 1fr 340px; gap: 24px; }
.video-main { min-width: 0; }
.player-wrap { background: #000; border-radius: 12px; overflow: hidden; aspect-ratio: 16/9; position: relative; border: 1px solid var(--border); }
.player-wrap iframe { width: 100%; height: 100%; border: 0; }
.player-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: linear-gradient(135deg, var(--bg-3), var(--bg-4)); }
.player-placeholder .play-big { width: 72px; height: 72px; border-radius: 50%; background: var(--red); display: flex; align-items: center; justify-content: center; }
.player-placeholder .ph-text { color: var(--text-2); font-size: 12px; }

/* Кастомный аудиоплеер (тёмная тема, вместо нативных controls) */
.audio-player { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.audio-play-btn { width: 44px; height: 44px; border-radius: 50%; background: var(--red); border: none; color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; transition: background .15s ease; }
.audio-play-btn:hover { background: var(--red-2); }
.audio-play-btn svg { width: 20px; height: 20px; }
.audio-progress { flex: 1; height: 6px; background: var(--bg-4); border-radius: 3px; cursor: pointer; position: relative; }
.audio-progress-fill { height: 100%; background: linear-gradient(90deg, var(--red), var(--red-3)); border-radius: 3px; width: 0%; }
.audio-time { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.audio-speeds { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.audio-speed-btn { border: 1px solid var(--border); background: transparent; color: var(--text-2); border-radius: 8px; padding: 4px 10px; font-size: 12px; cursor: pointer; transition: all .12s ease; }
.audio-speed-btn:hover { border-color: var(--border-2); color: var(--text); }
.audio-speed-btn.active { background: var(--red); color: #fff; border-color: var(--red); }

.video-meta-row { display: flex; gap: 10px; align-items: center; margin: 16px 0 0; font-size: 13px; color: #8A8A8A; }
.video-tags-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.video-page-title { font-size: 24px; font-weight: 700; letter-spacing: -0.3px; margin: 18px 0 14px; line-height: 1.25; }
.video-description { color: var(--text-2); line-height: 1.6; font-size: 14px; margin-bottom: 20px; }
.video-actions { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.btn-mark { background: var(--bg-3); border: 1px solid var(--border); color: var(--text); padding: 9px 16px; border-radius: 8px; font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.btn-mark:hover { background: var(--bg-4); }
.btn-mark.done { background: rgba(47,184,107,0.12); border-color: var(--green); color: var(--green); }
.btn-mark.done::before { content: '✓'; }
.btn-chat-tg { background: var(--red); color: #fff; padding: 9px 16px; border-radius: 8px; font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.btn-chat-tg:hover { background: var(--red-2); }

.video-sidebar { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.mat-list { display: flex; flex-direction: column; }
.mat-group-title {
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: #6A6A6A;
  margin: 14px 0 7px;
}
.mat-group-title:first-child { margin-top: 0; }
.mat-item {
  display: flex; align-items: center; gap: 11px;
  padding: 7px 10px; margin: 0 -10px; border-radius: 8px;
  border: 0.5px solid transparent;
  text-decoration: none;
}
.mat-icon { width: 17px; height: 17px; flex-shrink: 0; font-size: 17px; color: #8A8A8A; display: flex; align-items: center; justify-content: center; }
.mat-name { flex: 1; min-width: 0; font-size: 14px; color: #E0E0E0; line-height: 1.35; }
.mat-action-icon { width: 13px; height: 13px; flex-shrink: 0; font-size: 13px; color: #3A3A3A; }
.mat-item, .mat-icon, .mat-name, .mat-action-icon { transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease; }
@media (hover: hover) {
  .mat-item:hover { background: #1C1616; border-color: #E24B4A; }
  .mat-item:hover .mat-icon { color: #E24B4A; }
  .mat-item:hover .mat-name { color: #FFFFFF; }
  .mat-item:hover .mat-action-icon { color: #E24B4A; }
}
.mat-item:active { background: #1C1616; border-color: #E24B4A; }
.mat-item:active .mat-icon { color: #E24B4A; }
.mat-item:active .mat-name { color: #FFFFFF; }
.mat-item:active .mat-action-icon { color: #E24B4A; }
@media (prefers-reduced-motion: reduce) {
  .mat-item, .mat-icon, .mat-name, .mat-action-icon { transition: none; }
}

.broadcast-nav-heading { display: flex; align-items: center; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: #8A8A8A; font-weight: 400; margin-bottom: 14px; }
.broadcast-nav-heading-mark { display: inline-block; width: 22px; height: 2px; background: var(--accent-red); border-radius: 0; margin-right: 10px; flex-shrink: 0; }

.broadcast-nav { display: flex; flex-direction: column; gap: 10px; }
.broadcast-nav-item { display: block; padding: 14px; background: #141414; border: 0.5px solid #262626; border-radius: 10px; }
.broadcast-nav-item, .broadcast-nav-item .broadcast-nav-label, .broadcast-nav-item .broadcast-nav-title, .broadcast-nav-item .broadcast-nav-meta {
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.broadcast-nav-label { display: flex; justify-content: space-between; align-items: center; font-size: 10px; color: #7A7A7A; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; margin-bottom: 6px; }
.broadcast-nav-title { font-weight: 500; font-size: 14px; line-height: 1.35; color: #F2F2F2; }
.broadcast-nav-meta { font-size: 12px; color: #6E6E6E; margin-top: 5px; }
.broadcast-nav-arrow { width: 16px; height: 16px; color: #4A4A4A; flex-shrink: 0; transition: color 0.15s ease, transform 0.15s ease; }

@media (hover: hover) {
  .broadcast-nav-item:hover { background: #1C1616; border-color: var(--accent-red); }
  .broadcast-nav-item:hover .broadcast-nav-label { color: var(--accent-red); }
  .broadcast-nav-item:hover .broadcast-nav-arrow { color: var(--accent-red); }
  .broadcast-nav-item:hover .broadcast-nav-title { color: #FFFFFF; }
  .broadcast-nav-item:hover .broadcast-nav-meta { color: #8A7676; }
  .broadcast-nav-item:hover .broadcast-nav-arrow-prev { transform: translateX(-3px); }
  .broadcast-nav-item:hover .broadcast-nav-arrow-next { transform: translateX(3px); }
}
.broadcast-nav-item:active { background: #1C1616; border-color: var(--accent-red); }
.broadcast-nav-item:active .broadcast-nav-label { color: var(--accent-red); }
.broadcast-nav-item:active .broadcast-nav-arrow { color: var(--accent-red); }
.broadcast-nav-item:active .broadcast-nav-title { color: #FFFFFF; }
.broadcast-nav-item:active .broadcast-nav-meta { color: #8A7676; }
.broadcast-nav-item:active .broadcast-nav-arrow-prev { transform: translateX(-3px); }
.broadcast-nav-item:active .broadcast-nav-arrow-next { transform: translateX(3px); }

@media (prefers-reduced-motion: reduce) {
  .broadcast-nav-item, .broadcast-nav-item .broadcast-nav-label, .broadcast-nav-item .broadcast-nav-title,
  .broadcast-nav-item .broadcast-nav-meta, .broadcast-nav-arrow {
    transition: none;
  }
  .broadcast-nav-item:hover .broadcast-nav-arrow-prev, .broadcast-nav-item:hover .broadcast-nav-arrow-next,
  .broadcast-nav-item:active .broadcast-nav-arrow-prev, .broadcast-nav-item:active .broadcast-nav-arrow-next {
    transform: none;
  }
}

.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; font-weight: 500; margin-bottom: 16px; cursor: pointer; }
.back-link:hover { color: var(--text); }


.insight-block { background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin: 20px 0; }
.insight-header { display: flex; gap: 12px; margin-bottom: 14px; align-items: flex-start; }
.insight-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--bg-3); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.insight-title { font-weight: 700; font-size: 14px; }
.insight-sub { font-size: 12px; color: var(--text-2); margin-top: 3px; line-height: 1.4; }
.insight-textarea { width: 100%; background: var(--bg-3); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; color: var(--text); font: inherit; font-size: 13px; line-height: 1.5; min-height: 80px; resize: vertical; outline: none; }
.insight-textarea:focus { border-color: var(--red); }
.insight-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 10px; flex-wrap: wrap; }
.insight-hint { font-size: 11.5px; color: var(--text-3); }
.btn-insight-send { background: var(--red); color: #fff; border: none; padding: 8px 16px; border-radius: 8px; font-weight: 600; font-size: 13px; cursor: pointer; }
.btn-insight-send:hover { background: var(--red-2); }


/* ============================================================
   БРЕНДБУК: фон #0A0A0A, акцент #DA1B2E, Montserrat + Open Sans
   ============================================================ */
:root {
  --bg: #0A0A0A;
  --red: #DA1B2E; --red-2: #b31624; --red-3: #ff4054;
}
html, body { font-family: 'Open Sans', sans-serif; }
h1, h2, h3, .page-title, .brand-logo, .greeting-title, .stat-value,
.video-page-title, .cardinal-stage, .section-title, .cal-month,
.hub-tile-name, .login-logo { font-family: 'Montserrat', sans-serif; }

/* ============================================================
   ХАБ ПРОДУКТОВ
   ============================================================ */
.hub-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 48px 20px; }
.hub-brand { text-align: center; margin-bottom: 40px; }
.hub-brand .brand-logo { font-size: 32px; }
.hub-brand .brand-sub { margin-top: 4px; }
.hub-greeting { font-size: 15px; color: var(--text-2); margin-top: 16px; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 320px)); gap: 20px; justify-content: center; width: 100%; max-width: 1000px; }
.hub-tile { background: var(--bg-2); border: 1px solid var(--border); border-radius: 16px; padding: 32px 28px; cursor: pointer; position: relative; overflow: hidden; transition: border-color .15s, transform .15s; display: block; }
.hub-tile:hover { border-color: var(--red); transform: translateY(-2px); }
.hub-tile::before { content: ''; position: absolute; top: -40%; right: -20%; width: 220px; height: 220px; background: radial-gradient(circle, rgba(218,27,46,0.10) 0%, transparent 70%); pointer-events: none; }
.hub-tile-type { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; margin-bottom: 10px; }
.hub-tile-name { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; margin-bottom: 14px; line-height: 1.25; }
.hub-tile-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--green); font-weight: 600; }
.hub-tile-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.hub-tile-until { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.hub-tile-cta { margin-top: 16px; color: var(--red); font-weight: 700; font-size: 13px; }
.hub-tile.hub-crm { border-style: dashed; }
.hub-tile.hub-crm .hub-tile-name { color: var(--text-2); }
.hub-logout { margin-top: 40px; color: var(--text-3); font-size: 13px; }
.hub-logout:hover { color: var(--text); }

/* Переключатель продукта в шапке */
.product-switch { display: flex; align-items: center; gap: 10px; padding: 12px 24px 0; }
.product-switch a { font-size: 12px; color: var(--text-3); }
.product-switch a:hover { color: var(--text); }
.product-switch .cur { font-size: 12px; color: var(--text); font-weight: 700; }

/* ============================================================
   ЭКРАН ВХОДА
   ============================================================ */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-box { width: 100%; max-width: 380px; }
.login-logo { font-size: 34px; font-weight: 800; text-align: center; letter-spacing: -0.5px; }
.login-logo span { color: var(--red); }
.login-sub { text-align: center; color: var(--text-3); font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px; margin: 6px 0 32px; }
.login-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: 16px; padding: 32px 28px; }
.login-error { background: rgba(218,27,46,0.10); border: 1px solid rgba(218,27,46,0.4); color: var(--red-3); border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px; }
.login-hint { color: var(--text-2); font-size: 13px; margin-bottom: 16px; line-height: 1.5; }
.login-input { width: 100%; background: var(--bg-3); border: 1px solid var(--border); border-radius: 8px; padding: 13px 14px; color: var(--text); font-size: 15px; outline: none; }
.login-input:focus { border-color: var(--red); }
.login-input.code { text-align: center; font-size: 26px; letter-spacing: 10px; font-family: 'Montserrat', sans-serif; font-weight: 700; }
.login-btn { width: 100%; background: var(--red); color: #fff; padding: 13px; border-radius: 8px; font-weight: 700; font-size: 14px; margin-top: 16px; }
.login-btn:hover { background: var(--red-2); }
.login-alt { display: block; text-align: center; margin-top: 16px; color: var(--text-3); font-size: 13px; }
.login-alt:hover { color: var(--text); }

/* ============================================================
   МОБИЛЬНАЯ ВЕРСИЯ (участники заходят с телефонов, 390px)
   ============================================================ */
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; bottom: 0; top: auto; left: 0; right: 0; height: auto; z-index: 50;
    flex-direction: row; align-items: center; padding: 0; border-right: 0; border-top: 1px solid var(--border); }
  .brand, .support-block { display: none; }
  .user-block { padding: 0 10px; border-top: none; margin-top: 0; flex-shrink: 0; }
  .user-block .user-info { display: none; }
  .nav { display: flex; flex: 1; min-width: 0; padding: 4px; overflow-x: auto; overflow-y: hidden; }
  .nav-item { flex-direction: column; gap: 3px; padding: 8px 4px; font-size: 9.5px; flex: 1; min-width: 54px;
    justify-content: center; text-align: center; margin-bottom: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .nav-item.active::before { left: 8px; right: 8px; top: auto; bottom: 0; width: auto; height: 3px; border-radius: 3px 3px 0 0; }
  .nav-badge { position: absolute; top: 2px; right: 8px; margin-left: 0; }
  .sidebar-product-switch { position: fixed; top: 0; left: 0; right: 0; z-index: 40; padding: 10px 16px; background: var(--bg); border-bottom: 1px solid var(--border); }
  .sidebar-product-switch-label { display: none; }
  .sidebar-product-switch-menu { left: 16px; right: 16px; }
  .main { padding: 62px 16px 90px; max-width: 100%; }
  .page-title { font-size: 21px; }
  .home-grid, .content-grid, .kb-grid, .community-grid, .community-grid-secondary, .profile-grid, .gallery-grid, .schedule-layout { grid-template-columns: 1fr; }
  .video-page { grid-template-columns: 1fr; }
  .cardinal-card { grid-template-columns: 1fr; text-align: center; }
  .next-event { flex-direction: column; align-items: flex-start; }
  .content-toolbar { flex-direction: column; align-items: stretch; }
  .filter-tabs { overflow-x: auto; }
  .content-view-toggle { align-self: flex-end; }
  .video-row-tags { display: none; }
  .video-row-thumb { width: 60px; height: 40px; }
  .page-header { flex-direction: column; }
  .event-row { flex-wrap: wrap; }
  .hub-wrap { padding: 32px 16px; }
  .hub-grid { grid-template-columns: 1fr; }
  .product-switch { padding: 12px 16px 0; }
}

/* ---------- Topbar: notifications bell ---------- */
.bell-wrap { position: absolute; top: 24px; right: 24px; z-index: 10; }
.bell-btn { position: relative; background: none; border: none; color: var(--text-2); cursor: pointer; padding: 6px; display: flex; align-items: center; }
.bell-btn:hover { color: var(--text); }
.bell-badge { position: absolute; top: -2px; right: -4px; margin-left: 0; }
.notif-panel { display: none; position: absolute; top: calc(100% + 8px); right: 0; width: 320px; max-width: 84vw; background: var(--bg-2, #1a1a1a); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,0.45); z-index: 150; overflow: hidden; }
.notif-item { display: block; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.notif-item:hover { background: var(--bg-3); }
.notif-item.unread .notif-item-title::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #DA1B2E; margin-right: 6px; vertical-align: middle; }
.notif-item-title { font-size: 13px; font-weight: 600; color: var(--text); }
.notif-item-text { font-size: 12px; color: var(--text-2); margin-top: 2px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.notif-item-time { font-size: 11px; color: var(--text-3); margin-top: 3px; }
.notif-empty { padding: 16px 14px; font-size: 13px; color: var(--text-3); }
.notif-all { display: block; text-align: center; padding: 10px; font-size: 12.5px; font-weight: 700; color: #DA1B2E; }
.notif-all:hover { background: var(--bg-3); }

/* Прогресс кардинала: подписи под баром */
.cardinal-progress-text { font-size: 12px; color: var(--text-3); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.cardinal-next-label { color: var(--text-2); font-weight: 600; white-space: nowrap; }

/* Хаб: зелёная точка у срока доступа */
.hub-tile-until .dot-active { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-right: 6px; }

/* ---------- Гайд по платформе (аккордеон) ---------- */
/* ---------- Гид по платформе / Правила Стаи: пошаговый онбординг ---------- */
.gd-tag { font-size: 9px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--red); margin-bottom: 4px; }
.gd-h1 { font-weight: 900; font-size: clamp(1.6rem, 3vw + 0.4rem, 2.4rem); line-height: 1.08; letter-spacing: -0.015em; margin: 12px 0 14px; max-width: 620px; }
.gd-h1 span { color: var(--red); }
.gd-lead { font-size: 16px; line-height: 1.6; color: var(--text-2); max-width: 500px; margin: 0 0 36px; }

.gd-toc { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; max-width: 680px; margin-bottom: 28px; }
.gd-toc-head { background: var(--bg-2); padding: 14px 20px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-2); }
.gd-toc-item { display: flex; align-items: baseline; gap: 10px; padding: 10px 20px; border-bottom: 1px solid var(--border); font-size: 14px; font-weight: 500; color: var(--text-2); cursor: pointer; transition: color 0.15s; }
.gd-toc-item:last-child { border-bottom: none; }
.gd-toc-item:hover { color: var(--red); }
.gd-toc-num { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; color: var(--red); }

.gd-onboarding { display: none; height: 70vh; min-height: 460px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.gd-onboarding.show { display: flex; }
.gd-ob-sidebar { width: 230px; flex-shrink: 0; height: 100%; overflow-y: auto; border-right: 1px solid var(--border); padding: 20px 16px; background: var(--bg-2); display: flex; flex-direction: column; }
.gd-ob-back { font-size: 12px; color: var(--text-2); background: none; border: none; cursor: pointer; padding: 0; text-align: left; display: flex; align-items: center; gap: 6px; margin-bottom: 16px; }
.gd-ob-back:hover { color: var(--text); }
.gd-sb-group { font-size: 9px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-3); padding: 6px 0 10px; }
.gd-sb-item { display: flex; align-items: baseline; gap: 9px; padding: 6px 0; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--text-3); transition: color 0.15s; }
.gd-sb-item:hover { color: var(--text-2); }
.gd-sb-item.current { color: var(--text); }
.gd-sb-item.done { color: var(--text-2); }
.gd-sb-dot { font-size: 9px; font-weight: 700; letter-spacing: 0.1em; color: rgba(224,48,48,0.4); flex-shrink: 0; min-width: 14px; }
.gd-sb-item.current .gd-sb-dot, .gd-sb-item.done .gd-sb-dot { color: var(--red); }

.gd-ob-main { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100%; overflow: hidden; }
.gd-progress { height: 2px; background: var(--bg-3); flex-shrink: 0; }
.gd-progress-fill { height: 100%; background: var(--red); width: 0%; transition: width 0.4s ease; }
.gd-scroll { flex: 1; overflow-y: auto; padding: 32px 40px 24px; }
.gd-sec-num { font-weight: 900; font-size: 40px; line-height: 1; letter-spacing: -0.03em; margin-bottom: 18px; color: var(--text); }
.gd-h2 { font-weight: 700; font-size: 21px; line-height: 1.15; margin: 0 0 12px; }
.gd-p-lead { font-size: 15px; line-height: 1.6; color: var(--text-2); margin: 0 0 12px; }
.gd-p { font-size: 13.5px; line-height: 1.65; color: var(--text-2); margin: 0 0 10px; }
.gd-p:last-child { margin-bottom: 0; }
.gd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
.gd-shot { width: 100%; border-radius: 8px; border: 1px solid var(--border); display: block; }
.gd-shot-cap { font-size: 11px; color: var(--text-3); margin-top: 8px; }

.ifwhat { background: var(--bg-2); border-left: 3px solid var(--red); border-radius: 0 6px 6px 0; padding: 12px 16px; margin: 14px 0; }
.ifwhat-lbl { font-weight: 700; font-size: 9px; letter-spacing: 0.16em; color: var(--red); text-transform: uppercase; margin-bottom: 5px; }
.ifwhat-body { font-size: 12.5px; line-height: 1.6; color: var(--text-2); margin: 0; }

.gd-status-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 8px; }
.gd-status-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.gd-status-img { width: 44px; height: 44px; object-fit: contain; }

.gd-ach-row { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-top: 14px; }
.gd-ach-item { display: grid; grid-template-columns: 120px 1fr; border-bottom: 1px solid var(--border); }
.gd-ach-item:last-child { border-bottom: none; }
.gd-ach-cat { font-weight: 700; font-size: 12px; background: var(--bg-2); padding: 10px 14px; display: flex; align-items: center; border-right: 1px solid var(--border); }
.gd-ach-desc { font-size: 12.5px; line-height: 1.5; color: var(--text-2); padding: 10px 14px; display: flex; align-items: center; }

.gd-flow-steps { display: flex; align-items: center; gap: 8px; margin: 14px 0; flex-wrap: wrap; }
.gd-flow-step { background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 14px; display: flex; align-items: center; gap: 8px; }
.gd-flow-step.done { border-color: var(--red); }
.gd-flow-num { font-weight: 900; font-size: 10px; letter-spacing: 0.12em; color: var(--red); }
.gd-flow-lbl { font-weight: 600; font-size: 12.5px; }

.gd-ob-nav { flex-shrink: 0; border-top: 1px solid var(--border); padding: 14px 40px; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: var(--bg-2); }
.gd-progress-text { font-size: 11px; color: var(--text-3); letter-spacing: 0.06em; }

.gd-complete { display: none; max-width: 480px; padding: 40px 0; }
.gd-complete.show { display: block; }
.gd-complete-icon { width: 52px; height: 52px; border-radius: 50%; background: rgba(224,48,48,0.12); display: flex; align-items: center; justify-content: center; margin-bottom: 20px; color: var(--red); font-size: 22px; font-weight: 900; }
.gd-complete-h2 { font-weight: 900; font-size: 26px; margin: 10px 0 14px; }
.gd-complete-quote { font-size: 12px; font-weight: 500; color: var(--text-3); margin: 0 0 24px; }

@keyframes gdFadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.gd-fade { animation: gdFadeUp 0.35s cubic-bezier(.4,0,.2,1) both; }

@media (max-width: 760px) {
  .gd-onboarding.show { flex-direction: column; height: auto; }
  .gd-ob-sidebar { display: none; }
  .gd-grid, .gd-status-grid { grid-template-columns: 1fr; }
  .gd-scroll { padding: 20px; }
  .gd-ob-nav { padding: 14px 20px; }
  .gd-ach-item { grid-template-columns: 1fr; }
  .gd-ach-cat { border-right: none; border-bottom: 1px solid var(--border); }
  .bell-wrap { top: 70px; right: 16px; }
}

/* ---------- Оверлей «Запасные контакты» ---------- */
.contact-gate { position: fixed; inset: 0; z-index: 500; background: rgba(0,0,0,0.85); display: flex; align-items: center; justify-content: center; padding: 20px; }
.contact-gate-card { background: var(--bg-2); border: 1px solid var(--border-2); border-radius: 14px; padding: 32px; width: 440px; max-width: 100%; max-height: 90vh; overflow-y: auto; }
.contact-gate-title { font-family: 'Montserrat', sans-serif; font-size: 20px; font-weight: 700; margin-bottom: 12px; }
.contact-gate-text { font-size: 13.5px; line-height: 1.6; color: var(--text-2); margin-bottom: 24px; }
.contact-gate-field { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.contact-gate-field:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.contact-gate-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); margin-bottom: 8px; }
.contact-gate-input { width: 100%; background: var(--bg-3); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; color: var(--text); font-size: 13.5px; outline: none; margin-bottom: 10px; }
.contact-gate-input:focus { border-color: var(--border-2); }
.contact-gate-code-input { letter-spacing: 4px; font-weight: 700; }
.contact-gate-btn { width: 100%; background: #DA1B2E; color: #fff; border-radius: 8px; padding: 11px; font-size: 13.5px; font-weight: 700; text-align: center; }
.contact-gate-btn:disabled { opacity: 0.5; cursor: default; }
.contact-gate-link { width: 100%; text-align: center; padding: 10px; font-size: 12.5px; color: var(--text-2); text-decoration: underline; }
.contact-gate-link:disabled { opacity: 0.5; text-decoration: none; cursor: default; }
.contact-gate-hint { font-size: 12.5px; color: var(--yellow); margin: -4px 0 10px; cursor: pointer; text-decoration: underline; }
.contact-gate-ok { font-size: 13px; color: var(--green); font-weight: 600; }
.contact-gate-error { font-size: 12.5px; color: var(--red-3); margin-top: 8px; }

/* intl-tel-input: реcкин под тёмную тему платформы */
.contact-gate .iti { width: 100%; }
.iti__country-container { --iti-border-color: var(--border); }
.contact-gate .iti__tel-input,
.iti__dropdown-content { background: var(--bg-3); border-color: var(--border); color: var(--text); }
.iti__dropdown-content { border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.5); }
.iti__country { color: var(--text); }
.iti__country.iti__highlight { background: var(--bg-4); }
.iti__divider { border-bottom-color: var(--border); }
.iti__search-input { background: var(--bg-2); border-color: var(--border); color: var(--text); }
.iti__selected-country { background: transparent !important; }

/* ---------- Баннер «Подтвердите почту» ---------- */
.email-banner { position: sticky; top: 0; z-index: 90; background: var(--bg-4); border-bottom: 1px solid var(--border-2); color: var(--text); font-size: 13px; padding: 10px 16px; display: flex; align-items: center; justify-content: center; gap: 10px; text-align: center; }
.email-banner a { color: #DA1B2E; font-weight: 600; text-decoration: underline; }
.email-banner-close { color: var(--text-3); font-size: 18px; line-height: 1; padding: 0 4px; }
