/* =====================================================================
 * UI-компоненты дизайн-системы «Apple Materials + Dark Graphite-Violet».
 * Общие для всех страниц: стеклянный tooltip, split-кнопка скачивания (.dl-split + .dl-menu),
 * единое focus-visible кольцо, плавный cross-fade смены темы, морфинг иконок,
 * анимации <details> и тостов.
 * Токены — style.css / landing.css.
 * ===================================================================== */

/* ---------- Tooltip (стеклянный, автопозиционирование) ---------- */
.ui-tooltip {
  position: fixed; z-index: 95; max-width: 268px;
  padding: 6px 11px; border-radius: 10px;
  background: var(--glass-bg-strong); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: var(--glass-filter); backdrop-filter: var(--glass-filter);
  box-shadow: var(--glass-highlight), var(--elev-2);
  color: var(--text, var(--ink)); font-size: 12px; line-height: 1.4; font-weight: 500;
  pointer-events: none; opacity: 0; transform: translateY(4px) scale(.97);
  transition: opacity var(--dur-fast, 160ms) var(--ease-out, ease), transform var(--dur-fast, 160ms) var(--ease-spring, ease);
}
.ui-tooltip.is-visible { opacity: 1; transform: none; }
.ui-tooltip.is-below { transform: translateY(-4px) scale(.97); }
.ui-tooltip.is-below.is-visible { transform: none; }

/* ---------- Focus-visible (единое кольцо по всему сайту) ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible,
[role="menuitem"]:focus-visible,
[role="option"]:focus-visible,
[role="radio"]:focus-visible,
[role="tab"]:focus-visible {
  outline: 2px solid var(--accent-ring, #8b5cf6);
  outline-offset: 2px;
}

/* ---------- Split-Button «Скачать» + стеклянный Dropdown (.dl-split / .dl-menu) ---------- */
.dl-split {
  display: inline-flex;
  align-items: stretch;
  position: relative;
  border-radius: 999px;
  vertical-align: middle;
  isolation: isolate;
  transition: border-color 0.22s var(--ease-out, ease),
    box-shadow 0.25s var(--ease-out, ease),
    background-position 0.28s var(--ease-out, ease),
    transform 0.16s var(--ease-spring, ease);
}

/* Единая оболочка пилюли: фон, рамка, блик и тень общие на обе половинки */
.dl-split--primary {
  border: 1px solid var(--btn-border, rgba(167, 139, 250, 0.32));
  background-color: #232033;
  background-image: var(--btn-gradient, linear-gradient(135deg, #26213a 0%, #352b59 50%, #241f36 100%));
  background-size: 165% 165%;
  background-position: 0% 50%;
  box-shadow: var(--shadow-primary, inset 0 1px 0 rgba(255, 255, 255, 0.22), var(--accent-glow));
}
.dl-split--primary::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 54%);
  pointer-events: none;
  z-index: 0;
}
.dl-split--primary:hover,
.dl-split--primary:has(.dl-toggle[aria-expanded="true"]) {
  background-position: 100% 50%;
  border-color: var(--accent-border, rgba(167, 139, 250, 0.55));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), var(--accent-glow-hover, var(--accent-glow));
}

.dl-split--white {
  border: 0;
  background: #ffffff;
  box-shadow: 0 10px 30px -12px rgba(2, 6, 23, 0.5);
}
.dl-split--white:hover,
.dl-split--white:has(.dl-toggle[aria-expanded="true"]) {
  background: #ffffff;
  box-shadow: 0 16px 38px -12px rgba(2, 6, 23, 0.58);
}

/* Внутренние половинки никогда не прыгают по отдельности и не рисуют двойную рамку/градиент */
.dl-split > .dl-main,
.dl-split > .dl-toggle {
  position: relative;
  z-index: 1;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  transform: none !important;
  transition: background-color 0.16s ease, color 0.16s ease, opacity 0.16s ease !important;
}
.dl-split > .dl-main::after,
.dl-split > .dl-toggle::after {
  display: none !important;
}
.dl-split > .dl-main:hover,
.dl-split > .dl-main:active,
.dl-split > .dl-toggle:hover,
.dl-split > .dl-toggle:active {
  transform: none !important;
  box-shadow: none !important;
}

.dl-split > .dl-main {
  border-radius: 999px 0 0 999px !important;
}
.dl-split > .dl-main.btn-lg { padding-right: 22px; }
.dl-split > .dl-main.btn-sm { padding-right: 13px; }
.dl-split > .dl-main .dl-os-icon {
  width: 18px;
  height: 18px;
  flex: none;
  display: block;
}
.dl-split > .dl-main .dl-os-icon[data-os-icon="mac"] {
  transform: translateY(-1px);
}
.dl-split > .dl-main.btn-sm .dl-os-icon {
  width: 16px;
  height: 16px;
}

.dl-split > .dl-toggle {
  border-radius: 0 999px 999px 0 !important;
  padding: 0 !important;
  width: 38px;
  min-width: 38px;
  justify-content: center;
  flex: none;
  cursor: pointer;
}
.dl-split > .dl-toggle.btn-lg { width: 46px; min-width: 46px; }
.dl-split > .dl-toggle.btn-sm { width: 32px; min-width: 32px; }

/* Мягкая подсветка конкретной зоны под курсором (основная кнопка vs стрелка меню) */
.dl-split--primary > .dl-main:hover {
  background-color: rgba(255, 255, 255, 0.06) !important;
}
.dl-split--primary > .dl-toggle:hover,
.dl-split--primary > .dl-toggle[aria-expanded="true"] {
  background-color: rgba(255, 255, 255, 0.11) !important;
}
.dl-split--primary > .dl-main:active,
.dl-split--primary > .dl-toggle:active {
  background-color: rgba(255, 255, 255, 0.15) !important;
}

.dl-split--white > .dl-main:hover {
  background-color: rgba(15, 23, 42, 0.045) !important;
}
.dl-split--white > .dl-toggle:hover,
.dl-split--white > .dl-toggle[aria-expanded="true"] {
  background-color: rgba(15, 23, 42, 0.08) !important;
}
.dl-split--white > .dl-main:active,
.dl-split--white > .dl-toggle:active {
  background-color: rgba(15, 23, 42, 0.12) !important;
}

/* Единственный аккуратный разделитель во всю высоту капсулы */
.dl-split > .dl-toggle::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1px;
  bottom: 1px;
  width: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.22) 50%, rgba(255, 255, 255, 0.08));
  pointer-events: none;
  z-index: 2;
  transition: background 0.16s ease;
}
.dl-split--primary:hover > .dl-toggle::before,
.dl-split--primary:has(.dl-toggle[aria-expanded="true"]) > .dl-toggle::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0.14));
}
.dl-split--white > .dl-toggle::before {
  background: linear-gradient(180deg, rgba(28, 35, 64, 0.06), rgba(28, 35, 64, 0.16) 50%, rgba(28, 35, 64, 0.06));
}
.dl-split--white:hover > .dl-toggle::before,
.dl-split--white:has(.dl-toggle[aria-expanded="true"]) > .dl-toggle::before {
  background: linear-gradient(180deg, rgba(28, 35, 64, 0.1), rgba(28, 35, 64, 0.22) 50%, rgba(28, 35, 64, 0.1));
}

.dl-split > .dl-toggle svg {
  width: 15px;
  height: 15px;
  flex: none;
  transition: transform 0.2s var(--ease-spring, ease);
}
.dl-split > .dl-toggle.btn-lg svg { width: 17px; height: 17px; }
.dl-split > .dl-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}
.dl-split > .dl-main[data-download-pending="1"] {
  opacity: 0.88;
}

.dl-menu {
  position: fixed;
  z-index: 98;
  min-width: 282px;
  max-width: calc(100vw - 24px);
  padding: 6px;
  border-radius: 14px;
  background: var(--glass-bg-strong, rgba(18, 20, 28, 0.95));
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.12));
  -webkit-backdrop-filter: var(--glass-filter, blur(22px) saturate(160%));
  backdrop-filter: var(--glass-filter, blur(22px) saturate(160%));
  box-shadow: var(--glass-highlight, inset 0 1px 0 rgba(255, 255, 255, 0.08)),
    var(--elev-2, 0 20px 48px rgba(0, 0, 0, 0.46));
  color: var(--text, var(--ink, #f4f5f8));
  animation: ui-pop-in 0.18s var(--ease-spring, ease);
}
:root[data-theme="light"] .dl-menu {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(15, 23, 42, 0.1);
  box-shadow: 0 18px 44px -10px rgba(15, 23, 42, 0.18), 0 2px 8px rgba(15, 23, 42, 0.06);
  color: #141826;
}
.dl-menu[hidden] { display: none !important; }

.dl-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  text-align: left;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.dl-item + .dl-item { margin-top: 2px; }
.dl-item:hover,
.dl-item:focus-visible {
  background: var(--hover-bg, rgba(139, 92, 246, 0.12));
  text-decoration: none;
}
:root[data-theme="light"] .dl-item:hover,
:root[data-theme="light"] .dl-item:focus-visible {
  background: rgba(99, 102, 241, 0.09);
}

.dl-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(139, 92, 246, 0.13);
  color: var(--accent-text, #a78bfa);
  flex: none;
}
:root[data-theme="light"] .dl-item-icon {
  background: rgba(99, 102, 241, 0.1);
  color: #4f46e5;
}
.dl-item-icon svg { width: 18px; height: 18px; }

.dl-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dl-item-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.25;
}
.dl-item-sub {
  font-size: 11.5px;
  line-height: 1.25;
  color: var(--muted, var(--ink-muted, #9499ad));
}
:root[data-theme="light"] .dl-item-sub { color: #5b6275; }

.dl-item-soon {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
}
:root[data-theme="light"] .dl-item-soon {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}
.dl-item:not(.is-pending) .dl-item-soon { display: none; }

.dl-item-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: var(--accent-text, #a78bfa);
  opacity: 0;
  flex: none;
  transition: opacity 0.15s ease;
}
:root[data-theme="light"] .dl-item-check { color: #4f46e5; }
.dl-item-check svg { width: 17px; height: 17px; }
.dl-item.is-selected .dl-item-check { opacity: 1; }

/* ---------- Cross-fade смены темы (класс вешает ui.js на 350ms) ---------- */
html.theme-anim *,
html.theme-anim *::before,
html.theme-anim *::after {
  transition: background-color 0.28s ease, color 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease !important;
}

/* ---------- Общие микроанимации (60 fps, только transform и opacity) ---------- */
@keyframes ui-pop-in { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: scale(1); } }
@keyframes ui-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes ui-rise-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes ui-slide-in-right { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
@keyframes ui-icon-morph { from { opacity: 0; transform: scale(.65) rotate(-18deg); } to { opacity: 1; transform: none; } }
@keyframes ui-spin { to { transform: rotate(360deg); } }
@keyframes ui-details-open { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.ui-pop { animation: ui-pop-in var(--dur-base) var(--ease-spring); }
.ui-icon-morph { animation: ui-icon-morph 0.22s var(--ease-spring); }
.ui-spin { animation: ui-spin 0.85s linear infinite; }

/* Плавное раскрытие содержимого <details> на всех страницах (FAQ, API-доки, Размышления) */
details[open] > summary ~ * {
  animation: ui-details-open 0.24s var(--ease-spring);
}

/* Микроанимация прокрутки иконки обновления (баланс, админка) */
.is-refreshing svg {
  animation: ui-spin 0.65s var(--ease-spring);
}

/* Toast: стеклянная плашка, прогресс-полоса авто-dismiss и плавный уход */
.toast {
  position: relative;
  overflow: hidden;
  animation: ui-rise-in var(--dur-base) var(--ease-spring);
}
.toast::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%;
  background: var(--accent); opacity: .65; transform-origin: left;
  animation: ui-toast-progress 4.2s linear forwards;
}
.toast.ok::after { background: var(--ok); }
.toast.err::after { background: var(--danger); }
.toast.warn::after { background: var(--warn); }
@keyframes ui-toast-progress { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.toast.is-leaving { opacity: 0; transform: translateY(6px) scale(.98); transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out); }

@media (prefers-reduced-motion: reduce) {
  .ui-tooltip, .dl-menu, .dl-split > .dl-toggle svg, .toast, .toast::after, .ui-pop, .ui-icon-morph, .ui-spin, .is-refreshing svg, details[open] > summary ~ *, .notif-panel, .notif-banner, .feedback-backdrop, .feedback-modal {
    transition: none !important;
    animation: none !important;
  }
}

/* =====================================================================
 * Центр уведомлений (колокольчик в шапке, выпадающая панель, верхний баннер)
 * ===================================================================== */
.notif-bell-btn {
  position: relative;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  flex: none;
  border-radius: var(--radius-pill, 999px);
  border: 1px solid var(--glass-border, var(--border));
  background: var(--glass-bg, transparent);
  color: var(--muted);
  cursor: pointer;
  overflow: visible;
  transition: color var(--dur-fast, 150ms) var(--ease-out, ease),
    border-color var(--dur-fast, 150ms) var(--ease-out, ease),
    background var(--dur-fast, 150ms) var(--ease-out, ease),
    transform var(--dur-fast, 150ms) var(--ease-spring, ease);
}
.notif-bell-btn:hover,
.notif-bell-btn[aria-expanded="true"] {
  color: var(--text, var(--ink));
  border-color: var(--accent-border, rgba(167, 139, 250, 0.55));
  background: var(--hover-bg, rgba(139, 92, 246, 0.12));
}
.notif-bell-btn:active { transform: scale(0.92); }
.notif-bell-btn svg {
  width: 17px;
  height: 17px;
  display: block;
  pointer-events: none;
}
@media (hover: none) and (max-width: 768px) {
  .site-header .notif-bell-btn::before {
    content: "";
    position: absolute;
    inset: -4px -2px;
  }
}

.notif-bell-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: linear-gradient(135deg, #7c3aed, #db2777);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px var(--bg, #090a0c), 0 4px 10px rgba(124, 58, 237, 0.4);
  pointer-events: none;
}
:root[data-theme="light"] .notif-bell-badge {
  box-shadow: 0 0 0 2px #f5f5f7, 0 4px 10px rgba(124, 58, 237, 0.28);
}
.notif-bell-badge[hidden] { display: none !important; }

/* Выпадающая панель уведомлений */
.notif-panel {
  position: fixed;
  z-index: 98;
  width: min(410px, calc(100vw - 24px));
  max-height: min(560px, 76dvh);
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  background: var(--glass-bg-strong, rgba(18, 20, 28, 0.96));
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.12));
  -webkit-backdrop-filter: var(--glass-filter, blur(22px) saturate(160%));
  backdrop-filter: var(--glass-filter, blur(22px) saturate(160%));
  box-shadow: var(--glass-highlight, inset 0 1px 0 rgba(255, 255, 255, 0.08)),
    var(--elev-3, 0 24px 60px rgba(0, 0, 0, 0.55));
  color: var(--text, var(--ink, #f4f5f8));
  overflow: hidden;
  animation: ui-pop-in 0.18s var(--ease-spring, ease);
}
:root[data-theme="light"] .notif-panel {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(15, 23, 42, 0.1);
  box-shadow: 0 22px 54px -10px rgba(15, 23, 42, 0.2), 0 4px 14px rgba(15, 23, 42, 0.06);
  color: #141826;
}
.notif-panel[hidden] { display: none !important; }

.notif-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 14px 10px 16px;
  border-bottom: 1px solid var(--border-soft, rgba(255, 255, 255, 0.08));
}
:root[data-theme="light"] .notif-panel-head {
  border-bottom-color: rgba(15, 23, 42, 0.08);
}
.notif-panel-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  flex: 1;
  min-width: 0;
}
.notif-mark-all {
  border: 0;
  background: transparent;
  color: var(--accent-text, #a78bfa);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 8px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}
.notif-mark-all:hover { background: var(--hover-bg, rgba(139, 92, 246, 0.12)); }
.notif-mark-all[hidden] { display: none !important; }
:root[data-theme="light"] .notif-mark-all { color: #5b3da6; }

.notif-close-btn {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted, #9499ad);
  cursor: pointer;
  flex: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.notif-close-btn:hover { background: var(--hover-bg, rgba(139, 92, 246, 0.12)); color: var(--text, #fff); }
.notif-close-btn svg { width: 16px; height: 16px; }

.notif-filters {
  display: flex;
  gap: 6px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-soft, rgba(255, 255, 255, 0.06));
}
:root[data-theme="light"] .notif-filters {
  border-bottom-color: rgba(15, 23, 42, 0.06);
}
.notif-filter-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted, #9499ad);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.notif-filter-btn:hover { color: var(--text, var(--ink)); }
.notif-filter-btn[aria-pressed="true"] {
  background: var(--accent-soft, rgba(139, 92, 246, 0.16));
  border-color: var(--accent-border, rgba(167, 139, 250, 0.32));
  color: var(--accent-text, #c4b5fd);
}
:root[data-theme="light"] .notif-filter-btn[aria-pressed="true"] {
  background: rgba(91, 61, 166, 0.1);
  border-color: rgba(91, 61, 166, 0.25);
  color: #4c2f91;
}

.notif-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overscroll-behavior: contain;
}

.notif-item {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 11px 12px;
  border-radius: 13px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.notif-item:hover {
  background: var(--hover-bg, rgba(139, 92, 246, 0.08));
}
.notif-item.is-unread {
  background: rgba(139, 92, 246, 0.09);
  border-color: rgba(167, 139, 250, 0.22);
}
:root[data-theme="light"] .notif-item.is-unread {
  background: rgba(91, 61, 166, 0.06);
  border-color: rgba(91, 61, 166, 0.18);
}

.notif-item-ico {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  flex: none;
  background: rgba(139, 92, 246, 0.14);
  color: var(--accent-text, #c4b5fd);
}
.notif-item-ico svg { width: 17px; height: 17px; }
.notif-item-ico--warn { background: rgba(245, 158, 11, 0.16); color: #fbbf24; }
.notif-item-ico--critical { background: rgba(239, 68, 68, 0.16); color: #f87171; }
:root[data-theme="light"] .notif-item-ico { background: rgba(91, 61, 166, 0.1); color: #5b3da6; }
:root[data-theme="light"] .notif-item-ico--warn { background: rgba(245, 158, 11, 0.15); color: #b45309; }
:root[data-theme="light"] .notif-item-ico--critical { background: rgba(239, 68, 68, 0.14); color: #b91c1c; }

.notif-item-body {
  flex: 1;
  min-width: 0;
}
.notif-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 3px;
  font-size: 11.5px;
  color: var(--muted-2, #868c9e);
}
.notif-kind-tag {
  font-weight: 600;
  color: var(--accent-text, #c4b5fd);
}
.notif-kind-tag--warn { color: #fbbf24; }
.notif-kind-tag--critical { color: #f87171; }
:root[data-theme="light"] .notif-kind-tag { color: #5b3da6; }
:root[data-theme="light"] .notif-kind-tag--warn { color: #b45309; }
:root[data-theme="light"] .notif-kind-tag--critical { color: #b91c1c; }

.notif-unread-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8b5cf6;
  margin-left: auto;
  flex: none;
}
.notif-item:not(.is-unread) .notif-unread-dot { display: none; }

.notif-item-title {
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.35;
  margin: 0 0 4px;
  color: var(--text, var(--ink));
}
.notif-item-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted, #a1a6b3);
  white-space: pre-line;
  overflow-wrap: anywhere;
  margin: 0;
}
:root[data-theme="light"] .notif-item-text { color: #4b5263; }

.notif-item-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-text, #c4b5fd);
  text-decoration: none;
}
.notif-item-action:hover { text-decoration: underline; }
:root[data-theme="light"] .notif-item-action { color: #5b3da6; }

.notif-empty {
  padding: 34px 18px;
  text-align: center;
  color: var(--muted, #9499ad);
  font-size: 13px;
  line-height: 1.5;
}
.notif-empty-ico {
  width: 40px;
  height: 40px;
  margin: 0 auto 10px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--glass-bg, rgba(255, 255, 255, 0.05));
  color: var(--muted-2, #868c9e);
}
.notif-empty-ico svg { width: 20px; height: 20px; }
.notif-empty strong { display: block; color: var(--text, var(--ink)); font-size: 14px; margin-bottom: 4px; }

.notif-panel-foot {
  padding: 9px 16px;
  border-top: 1px solid var(--border-soft, rgba(255, 255, 255, 0.08));
  font-size: 12px;
  color: var(--muted-2, #868c9e);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.notif-panel-foot[hidden] { display: none !important; }
.notif-panel-foot a {
  color: var(--accent-text, #c4b5fd);
  font-weight: 600;
  text-decoration: none;
}
.notif-panel-foot a:hover { text-decoration: underline; }
:root[data-theme="light"] .notif-panel-foot { border-top-color: rgba(15, 23, 42, 0.08); }
:root[data-theme="light"] .notif-panel-foot a { color: #5b3da6; }

/* Верхний системный баннер (техработы / важные уведомления) */
.notif-banner-host {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 16px 0;
  width: min(1160px, 100%);
  margin: 0 auto;
  z-index: 25;
}
.notif-banner-host:empty { display: none; padding: 0; }
.notif-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--accent-border, rgba(167, 139, 250, 0.32));
  background: var(--accent-soft, rgba(139, 92, 246, 0.14));
  color: var(--text, var(--ink));
  font-size: 13.5px;
  line-height: 1.45;
  animation: ui-rise-in 0.22s var(--ease-spring, ease);
}
.notif-banner--warn {
  border-color: var(--warn-border-strong, rgba(245, 158, 11, 0.45));
  background: var(--warn-soft, rgba(245, 158, 11, 0.14));
}
.notif-banner--critical {
  border-color: var(--danger-border-strong, rgba(239, 68, 68, 0.48));
  background: var(--danger-soft, rgba(239, 68, 68, 0.14));
}
.notif-banner-ico {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--accent-text, #c4b5fd);
}
.notif-banner--warn .notif-banner-ico { color: #fbbf24; }
.notif-banner--critical .notif-banner-ico { color: #f87171; }
:root[data-theme="light"] .notif-banner--warn .notif-banner-ico { color: #b45309; }
:root[data-theme="light"] .notif-banner--critical .notif-banner-ico { color: #b91c1c; }

.notif-banner-content {
  flex: 1;
  min-width: 0;
}
.notif-banner-content strong { font-weight: 650; margin-right: 6px; }
.notif-banner-link {
  flex: none;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-text, #c4b5fd);
  text-decoration: none;
  white-space: nowrap;
}
.notif-banner-link:hover { text-decoration: underline; }
:root[data-theme="light"] .notif-banner-link { color: #5b3da6; }

.notif-banner-close {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted, #9499ad);
  cursor: pointer;
  flex: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.notif-banner-close:hover { background: var(--hover-bg, rgba(255, 255, 255, 0.1)); color: var(--text, var(--ink)); }
.notif-banner-close svg { width: 15px; height: 15px; }

@media (max-width: 768px) {
  .notif-banner-host { padding: 6px 12px 0; }
  .notif-banner { padding: 9px 11px; font-size: 13px; }
  .notif-panel { max-height: min(520px, 78dvh); }
}

/* =====================================================================
 * Обратная связь (иконка в шапке + стеклянная модалка)
 * ===================================================================== */
.feedback-btn {
  position: relative;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  flex: none;
  border-radius: var(--radius-pill, 999px);
  border: 1px solid var(--glass-border, var(--border));
  background: var(--glass-bg, transparent);
  color: var(--muted);
  cursor: pointer;
  overflow: visible;
  transition: color var(--dur-fast, 150ms) var(--ease-out, ease),
    border-color var(--dur-fast, 150ms) var(--ease-out, ease),
    background var(--dur-fast, 150ms) var(--ease-out, ease),
    transform var(--dur-fast, 150ms) var(--ease-spring, ease);
}
.feedback-btn[hidden] { display: none !important; }
.feedback-btn:hover {
  color: var(--text, var(--ink));
  border-color: var(--accent-border, rgba(167, 139, 250, 0.55));
  background: var(--hover-bg, rgba(139, 92, 246, 0.12));
}
.feedback-btn:active { transform: scale(0.92); }
.feedback-btn svg { width: 17px; height: 17px; display: block; pointer-events: none; }
@media (hover: none) and (max-width: 768px) {
  .site-header .feedback-btn::before {
    content: "";
    position: absolute;
    inset: -4px -2px;
  }
}

.feedback-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: linear-gradient(135deg, #7c3aed, #db2777);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px var(--bg, #090a0c), 0 4px 10px rgba(124, 58, 237, 0.4);
  pointer-events: none;
}
:root[data-theme="light"] .feedback-badge {
  box-shadow: 0 0 0 2px #f5f5f7, 0 4px 10px rgba(124, 58, 237, 0.28);
}
.feedback-badge[hidden] { display: none !important; }

.feedback-backdrop {
  position: fixed;
  inset: 0;
  z-index: 105;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--scrim, rgba(5, 6, 10, 0.65));
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: ui-fade-in 0.18s var(--ease-out, ease);
}
.feedback-backdrop[hidden] { display: none !important; }

.feedback-modal {
  width: min(600px, 100%);
  max-height: min(88dvh, 760px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 24px;
  background: var(--glass-bg-strong, rgba(18, 20, 28, 0.96));
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.12));
  -webkit-backdrop-filter: var(--glass-filter, blur(22px) saturate(160%));
  backdrop-filter: var(--glass-filter, blur(22px) saturate(160%));
  box-shadow: var(--glass-highlight, inset 0 1px 0 rgba(255, 255, 255, 0.08)),
    var(--elev-3, 0 24px 64px rgba(0, 0, 0, 0.56));
  color: var(--text, var(--ink, #f4f5f8));
  animation: ui-pop-in 0.2s var(--ease-spring, ease);
}
:root[data-theme="light"] .feedback-modal {
  background: rgba(255, 255, 255, 0.97);
  border-color: rgba(15, 23, 42, 0.1);
  box-shadow: 0 24px 60px -12px rgba(15, 23, 42, 0.22), 0 4px 14px rgba(15, 23, 42, 0.06);
  color: #141826;
}

.feedback-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 16px 22px;
  border-bottom: 1px solid var(--border-soft, rgba(255, 255, 255, 0.08));
}
:root[data-theme="light"] .feedback-modal-head { border-bottom-color: rgba(15, 23, 42, 0.08); }

.feedback-head-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}
.feedback-head-ico {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-grid;
  place-items: center;
  flex: none;
  background: var(--accent-soft, rgba(139, 92, 246, 0.16));
  color: var(--accent-text, #c4b5fd);
}
.feedback-head-ico svg { width: 22px; height: 22px; }
:root[data-theme="light"] .feedback-head-ico { background: rgba(91, 61, 166, 0.11); color: #5b3da6; }

.feedback-modal-head h2 {
  margin: 2px 0 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.feedback-modal-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted, #9499ad);
  line-height: 1.35;
}
:root[data-theme="light"] .feedback-modal-sub { color: #5b6275; }

.feedback-modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 22px 22px;
  overscroll-behavior: contain;
}

.feedback-form {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
  background: var(--glass-bg, rgba(255, 255, 255, 0.03));
}
:root[data-theme="light"] .feedback-form {
  background: rgba(15, 23, 42, 0.03);
  border-color: rgba(15, 23, 42, 0.08);
}

.feedback-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted, #a1a6b3);
  margin-bottom: 8px;
}
:root[data-theme="light"] .feedback-label { color: #4b5263; }

.feedback-textarea {
  width: 100%;
  min-height: 86px;
  resize: none;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.14));
  background: var(--input-bg, rgba(9, 10, 14, 0.55));
  color: var(--text, var(--ink));
  font: inherit;
  font-size: 14.5px;
  line-height: 1.5;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
:root[data-theme="light"] .feedback-textarea {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.14);
  color: #141826;
}
.feedback-textarea:focus {
  outline: none;
  border-color: var(--accent-border, rgba(167, 139, 250, 0.6));
  box-shadow: 0 0 0 3px var(--accent-ring, rgba(139, 92, 246, 0.25));
}
.feedback-textarea.is-error {
  border-color: var(--danger-border-strong, rgba(239, 68, 68, 0.65));
}

.feedback-form-error {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 11px;
  border: 1px solid var(--danger-border, rgba(239, 68, 68, 0.35));
  background: var(--danger-soft, rgba(239, 68, 68, 0.12));
  color: var(--danger-text, #fca5a5);
  font-size: 13px;
  line-height: 1.45;
}
.feedback-form-error[hidden] { display: none !important; }
:root[data-theme="light"] .feedback-form-error { color: #b91c1c; }

.feedback-form-foot {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}
.feedback-hint {
  flex: 1 1 180px;
  font-size: 12px;
  color: var(--muted-2, #868c9e);
  margin: 0;
}
.feedback-hint.is-error { color: var(--danger-text, #f87171); }
:root[data-theme="light"] .feedback-hint.is-error { color: #b91c1c; }

.feedback-counter {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--muted-2, #868c9e);
}
.feedback-counter.is-error {
  color: var(--danger-text, #f87171);
  font-weight: 600;
}
:root[data-theme="light"] .feedback-counter.is-error { color: #b91c1c; }

.feedback-submit {
  min-height: 40px;
  padding: 0 18px;
  font-size: 13.5px;
}
.feedback-submit svg { width: 16px; height: 16px; }

.feedback-list-head {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.feedback-list-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.feedback-list-title-wrap h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
}
.feedback-count-pill {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--glass-bg, rgba(255, 255, 255, 0.08));
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
  font-size: 12px;
  font-weight: 600;
  color: var(--muted, #9499ad);
  font-variant-numeric: tabular-nums;
}
.feedback-count-pill[hidden] { display: none !important; }

.feedback-toggle-all {
  border: 0;
  background: transparent;
  color: var(--accent-text, #c4b5fd);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
}
.feedback-toggle-all:hover { background: var(--hover-bg, rgba(139, 92, 246, 0.12)); }
.feedback-toggle-all[hidden] { display: none !important; }
:root[data-theme="light"] .feedback-toggle-all { color: #5b3da6; }

.feedback-items {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.feedback-empty {
  padding: 26px 16px;
  text-align: center;
  border: 1px dashed var(--glass-border, rgba(255, 255, 255, 0.14));
  border-radius: 16px;
  font-size: 13px;
  color: var(--muted, #9499ad);
}

.feedback-item {
  padding: 14px 15px;
  border-radius: 16px;
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
  background: var(--glass-bg, rgba(255, 255, 255, 0.03));
}
:root[data-theme="light"] .feedback-item {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.09);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}
.feedback-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.feedback-item-date {
  font-size: 12px;
  color: var(--muted-2, #868c9e);
  font-variant-numeric: tabular-nums;
}
.feedback-status-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.feedback-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  white-space: nowrap;
  border: 1px solid transparent;
}
.feedback-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.feedback-status--pending {
  background: rgba(59, 130, 246, 0.14);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.32);
}
.feedback-status--in_progress {
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.32);
}
.feedback-status--done {
  background: rgba(34, 197, 94, 0.14);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.32);
}
.feedback-status--rejected {
  background: rgba(148, 163, 184, 0.12);
  color: var(--muted, #94a3b8);
  border-color: rgba(148, 163, 184, 0.24);
}
:root[data-theme="light"] .feedback-status--pending { color: #1d4ed8; background: rgba(59, 130, 246, 0.11); }
:root[data-theme="light"] .feedback-status--in_progress { color: #b45309; background: rgba(245, 158, 11, 0.12); }
:root[data-theme="light"] .feedback-status--done { color: #15803d; background: rgba(34, 197, 94, 0.11); }
:root[data-theme="light"] .feedback-status--rejected { color: #475569; background: rgba(100, 116, 139, 0.1); }

.feedback-item-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.feedback-chevron {
  width: 15px;
  height: 15px;
  color: var(--muted-2, #868c9e);
  transition: transform 0.18s ease;
  flex: none;
}
.feedback-item-trigger[aria-expanded="true"] .feedback-chevron { transform: rotate(180deg); }

.feedback-item-text {
  margin: 7px 0 0;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text, var(--ink));
}
.feedback-reply {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--accent-soft, rgba(139, 92, 246, 0.12));
  border: 1px solid var(--accent-border, rgba(167, 139, 250, 0.24));
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.feedback-reply strong {
  color: var(--accent-text, #c4b5fd);
  font-weight: 650;
  margin-right: 4px;
}
:root[data-theme="light"] .feedback-reply {
  background: rgba(91, 61, 166, 0.07);
  border-color: rgba(91, 61, 166, 0.18);
}
:root[data-theme="light"] .feedback-reply strong { color: #5b3da6; }

@media (max-width: 768px) {
  .feedback-backdrop {
    padding: 0;
    align-items: end;
  }
  .feedback-modal {
    max-height: 92dvh;
    border-radius: 22px 22px 0 0;
  }
  .feedback-modal-head { padding: 16px 16px 14px; }
  .feedback-modal-body { padding: 14px 16px calc(18px + env(safe-area-inset-bottom)); }
}
