/* Rusff Notifications shared styles — legacy v1 + Worker v2.5.1
 * Общие стили окна, настроек, счётчиков, событий и диагностики транспорта.
 * Нижняя секция Worker v2 расширяет прежнее оформление; цвета форума
 * переопределяются CSS-переменными в установочном HTML-блоке.
 */

/* Root switches: keep the menu link available so settings can be re-enabled. */
html.kj-notifications-all-off .nav-item-notifications .bubble,
html.kj-notifications-all-off #pun-ulinks a[href*="p=notifications"] .bubble {
  display: none !important;
}

/*
 * Счётчик рядом с пунктом «Уведомления».
 * Штатный .bubble на разных темах Rusff бывает привязан ко всему #pun-ulinks,
 * поэтому задаём устойчивую точку отсчёта непосредственно на ссылке.
 */
#pun-ulinks a[href*="p=notifications"] {
  position: relative;
}

#pun-ulinks a[href*="p=notifications"] .kj-notifications-menu-count {
  position: absolute;
  top: 2px;
  right: 1px;
  z-index: 2;
  box-sizing: border-box;
  width: 18px;
  min-width: 18px;
  height: 18px;
  padding: 0;
  color: var(--kj-notify-menu-count-color, #fff);
  font: 700 9px/18px Arial, sans-serif;
  text-align: center;
  background: var(--kj-notify-menu-count-bg, #9e4448);
  border: 1px solid var(--kj-notify-menu-count-border, rgba(255, 255, 255, .9));
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .28);
  transform: translate(38%, -38%);
  pointer-events: none;
}

/* Некоторые темы рисуют штатной .bubble декоративный треугольный хвост. У
 * нашего круглого счётчика он превращался во второй красный элемент. */
#pun-ulinks a[href*="p=notifications"] .kj-notifications-menu-count::before,
#pun-ulinks a[href*="p=notifications"] .kj-notifications-menu-count::after {
  display: none !important;
  content: none !important;
}

html.kj-notifications-popups-off #jGrowl .notify-message,
html.kj-notifications-popups-off .jGrowl .notify-message {
  display: none !important;
}

body.kj-notifications-open {
  overflow: hidden !important;
}

#kj-notifications-modal[hidden] {
  display: none !important;
}

#kj-notifications-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483001;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 16px;
  color: #272727;
  font: 14px/1.45 Arial, sans-serif;
}

#kj-notifications-modal .kj-notifications-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .58);
  backdrop-filter: blur(2px);
}

#kj-notifications-modal .kj-notifications-dialog {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto;
  width: calc(100% - 32px);
  max-width: 720px;
  height: auto;
  max-height: calc(100% - 32px);
  overflow: hidden;
  background: #f7f7f7;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .38);
}

#kj-notifications-modal .kj-notifications-header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px 0 18px;
  color: #fff;
  background: #252525;
}

#kj-notifications-modal .kj-notifications-title {
  min-width: 0;
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

#kj-notifications-modal .kj-notifications-count {
  display: none;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  background: #b74747;
  border-radius: 10px;
}

#kj-notifications-modal .kj-notifications-full {
  margin-left: auto;
  color: #ddd;
  font-size: 12px;
  text-decoration: none;
}

#kj-notifications-modal .kj-notifications-full:hover {
  color: #fff;
  text-decoration: underline;
}

#kj-notifications-modal .kj-notifications-close {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  padding: 0;
  color: #fff;
  font: 26px/32px Arial, sans-serif;
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

#kj-notifications-modal .kj-notifications-close:hover,
#kj-notifications-modal .kj-notifications-close:focus {
  background: rgba(255, 255, 255, .14);
  outline: none;
}

#kj-notifications-modal .kj-notifications-tabs {
  display: flex;
  min-height: 42px;
  padding: 0 14px;
  background: #fff;
  border-bottom: 1px solid #ddd;
}

#kj-notifications-modal .kj-notifications-tab {
  position: relative;
  padding: 0 16px;
  color: #666;
  font: inherit;
  font-weight: 700;
  background: transparent;
  border: 0;
  cursor: pointer;
}

#kj-notifications-modal .kj-notifications-tab.is-active {
  color: #222;
}

#kj-notifications-modal .kj-notifications-tab.is-active::after {
  content: '';
  position: absolute;
  right: 10px;
  bottom: 0;
  left: 10px;
  height: 3px;
  background: #9d3f3f;
  border-radius: 3px 3px 0 0;
}

#kj-notifications-modal .kj-notifications-content {
  position: relative;
  min-height: 0;
  max-height: calc(100vh - 140px);
  overflow: hidden;
  background: #fff;
}

#kj-notifications-modal .kj-notifications-loader {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #777;
  background: #fff;
}

#kj-notifications-modal .kj-notifications-loader[hidden] {
  display: none !important;
}

#kj-notifications-modal iframe {
  display: block;
  width: 100%;
  height: 180px;
  max-height: calc(100vh - 140px);
  background: #fff;
  border: 0;
}

/* This same-origin helper carries the account's native e-mail preference. */
#kj-notifications-modal .kj-notifications-email-frame {
  display: none !important;
}

/* The iframe loads the same stylesheet; these rules turn the native page into content. */
body.kj-notifications-embedded {
  margin: 0 !important;
  padding: 0 !important;
  min-width: 0 !important;
  color: #292929 !important;
  background: #fff !important;
  font: 14px/1.45 Arial, sans-serif !important;
}

body.kj-notifications-embedded > div:not(#pun_wrap),
body.kj-notifications-embedded > iframe,
body.kj-notifications-embedded .caramel-fadeInBox {
  display: none !important;
}

body.kj-notifications-embedded #pun_wrap,
body.kj-notifications-embedded #pun {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #fff !important;
}

body.kj-notifications-embedded #pun-title,
body.kj-notifications-embedded #pun-navlinks,
body.kj-notifications-embedded #pun-status,
body.kj-notifications-embedded #pun-ulinks,
body.kj-notifications-embedded #pun-crumbs1,
body.kj-notifications-embedded #pun-crumbs2,
body.kj-notifications-embedded #pun-footer,
body.kj-notifications-embedded #pun-about,
body.kj-notifications-embedded #pun-break1,
body.kj-notifications-embedded #pun-break2,
body.kj-notifications-embedded #profilenav,
body.kj-notifications-embedded #pun-main h1,
body.kj-notifications-embedded #MyBookmarks,
body.kj-notifications-embedded #html-footer,
body.kj-notifications-embedded .linkst,
body.kj-notifications-embedded .crumbs,
body.kj-notifications-embedded .modmenu {
  display: none !important;
}

body.kj-notifications-embedded #pun-main,
body.kj-notifications-embedded #profile {
  width: auto !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
  background: #fff !important;
}

body.kj-notifications-embedded #profile > .container,
body.kj-notifications-embedded #profile .container {
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #fff !important;
  border: 0 !important;
  box-shadow: none !important;
}

body.kj-notifications-embedded #profileContainer {
  box-sizing: border-box !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 14px 16px 22px !important;
  background: #fff !important;
}

body.kj-notifications-embedded #profileContainer fieldset {
  box-sizing: border-box !important;
  margin: 0 0 14px !important;
  padding: 0 !important;
  background: #fff !important;
  border: 1px solid #ddd !important;
  border-radius: 8px !important;
}

body.kj-notifications-embedded #profileContainer fieldset legend {
  box-sizing: border-box !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 11px 14px !important;
  color: #222 !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  background: #f4f4f4 !important;
  border-bottom: 1px solid #ddd !important;
  border-radius: 8px 8px 0 0 !important;
}

body.kj-notifications-embedded #profileContainer .fs-box {
  box-sizing: border-box !important;
  padding: 12px 14px !important;
}

body.kj-notifications-embedded #profileContainer .infofield {
  margin: 0 0 12px !important;
  padding: 9px 11px !important;
  color: #666 !important;
  background: #f7f7f7 !important;
  border-radius: 6px !important;
}

body.kj-notifications-embedded #profileContainer .checkfield {
  display: flex !important;
  align-items: flex-start !important;
  gap: 9px !important;
  margin: 0 !important;
  padding: 10px 2px !important;
  border-bottom: 1px solid #eee !important;
}

body.kj-notifications-embedded #profileContainer .checkfield:last-of-type {
  border-bottom: 0 !important;
}

body.kj-notifications-embedded #profileContainer .checkfield .input {
  flex: 0 0 auto !important;
}

body.kj-notifications-embedded #profileContainer .checkfield label {
  cursor: pointer !important;
}

body.kj-notifications-embedded #profileContainer .formsubmit {
  margin: 12px 0 0 !important;
  padding: 0 !important;
}

body.kj-notifications-embedded #profileContainer input.button {
  padding: 7px 13px !important;
  cursor: pointer !important;
}

body.kj-notifications-embedded #profileContainer a {
  color: #9d3f3f !important;
}

body.kj-notifications-history .kj-notify-settings,
body.kj-notifications-history .kj-notify-telegram {
  display: none !important;
}

body.kj-notifications-settings .kj-notify-history {
  display: none !important;
}

/* Custom switches are deliberately styled like the native settings rows. */
.kj-custom-notification-settings {
  margin: 0 0 14px;
  border-bottom: 1px solid #ddd;
}

.kj-custom-notification-settings h3 {
  margin: 0;
  padding: 0 2px 8px;
  color: #222;
  font-size: 14px;
}

.kj-custom-setting-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0;
  padding: 9px 2px;
  border-top: 1px solid #eee;
  cursor: pointer;
}

.kj-custom-setting-input {
  flex: 0 0 auto;
  margin-top: 2px;
}

.kj-custom-setting-copy {
  display: block;
  min-width: 0;
}

.kj-custom-setting-copy strong,
.kj-custom-setting-copy small {
  display: block;
}

.kj-custom-setting-copy small {
  margin-top: 2px;
  color: #777;
  font-size: 12px;
  line-height: 1.35;
}

.kj-custom-notification-settings.is-disabled .kj-custom-setting-row:not(:first-of-type) {
  opacity: .55;
}

/* Native and custom events share one direct-child list and one visual rhythm. */
#profileContainer .kj-notify-history .fs-box > .kj-notify-card {
  position: relative !important;
  margin: 0 !important;
  padding: 12px 8px 12px 12px !important;
  border-bottom: 1px solid #ececec !important;
}

#profileContainer .kj-subscription-notification {
  cursor: pointer !important;
}

#profileContainer .kj-subscription-notification:hover {
  background: #f6f6f6 !important;
}

.kj-subscription-notification-icon {
  background: #197c78 !important;
}

.kj-subscription-notification.is-read .kj-subscription-notification-icon {
  background: #b8b8b8;
}

/* Fallback polish for jGrowl subscription cards. */
#jGrowl .kj-subscription-toast .kj-subscription-popup-content,
.jGrowl .kj-subscription-toast .kj-subscription-popup-content {
  display: block;
  color: inherit;
  text-decoration: none;
}

#jGrowl .kj-subscription-toast .kj-subscription-popup-content span,
.jGrowl .kj-subscription-toast .kj-subscription-popup-content strong {
  display: block;
}

@media (max-width: 640px) {
  #kj-notifications-modal {
    padding: 0;
  }

  #kj-notifications-modal .kj-notifications-dialog {
    width: 100%;
    height: auto;
    max-height: 100%;
    border: 0;
    border-radius: 0;
  }

  #kj-notifications-modal .kj-notifications-full {
    display: none;
  }

  #kj-notifications-modal .kj-notifications-tabs {
    padding: 0 6px;
  }

  #kj-notifications-modal .kj-notifications-tab {
    flex: 1 1 50%;
    padding: 0 6px;
  }

  body.kj-notifications-embedded #profileContainer {
    padding: 10px 8px 18px !important;
  }

  body.kj-notifications-embedded #profileContainer fieldset {
    border-radius: 6px !important;
  }

  body.kj-notifications-embedded #profileContainer .fs-box {
    padding: 10px !important;
  }
}

/* --------------------------------------------------------------------------
 * Worker Notifications v2: прямая история без iframe страницы профиля.
 * Цвета намеренно используют переменные с нейтральными fallback-значениями:
 * конкретный форум может переопределить их рядом с установочным блоком.
 * -------------------------------------------------------------------------- */
#kj-notifications-modal .kj-worker-mark-all {
  margin-left: auto;
  padding: 5px 9px;
  color: inherit;
  font: inherit;
  font-weight: 700;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 7px;
  cursor: pointer;
}

#kj-notifications-modal .kj-worker-content {
  overflow: auto;
  padding: 14px;
  background: var(--kj-notify-surface, #f5f2ed);
}

#kj-notifications-modal .kj-worker-panel[hidden] {
  display: none !important;
}

#kj-notifications-modal .kj-worker-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
  padding: 2px 3px 2px 0;
}

#kj-notifications-modal .kj-worker-filter {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 36px;
  height: 34px;
  padding: 0;
  color: var(--kj-notify-text, #292929);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  background: var(--kj-notify-card, #fff);
  border: 1px solid var(--kj-notify-line, #d7d0c7);
  border-radius: 8px;
  cursor: pointer;
}

#kj-notifications-modal .kj-worker-filter-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  font-size: 15px;
  line-height: 1;
}

/* Подпись остаётся в DOM для экранных читалок и подсказки, но визуальный ряд
 * собирается только из символов — без заимствования чужой формы кнопок. */
#kj-notifications-modal .kj-worker-filter-label {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  white-space: nowrap;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  border: 0;
}

#kj-notifications-modal .kj-worker-filter-count {
  position: absolute;
  right: 3px;
  bottom: 2px;
  z-index: 1;
  display: none;
  min-width: 0;
  height: auto;
  padding: 0;
  color: #8b8580;
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
  background: transparent;
  border: 0;
  border-radius: 0;
}

#kj-notifications-modal .kj-worker-filter.has-count .kj-worker-filter-count {
  display: block;
}

#kj-notifications-modal .kj-worker-filter.is-active {
  color: var(--kj-notify-accent-contrast, #fff);
  background: var(--kj-notify-accent, #8d3f46);
  border-color: var(--kj-notify-accent, #8d3f46);
}

#kj-notifications-modal .kj-worker-filter.is-active .kj-worker-filter-count {
  color: rgba(255, 255, 255, .72);
  background: transparent;
}

/* У прочитанных категорий число остаётся спокойным серым индексом. Если внутри
 * есть новые события, только сама цифра становится крупнее и контрастнее. */
#kj-notifications-modal .kj-worker-filter.has-unread .kj-worker-filter-count {
  color: var(--kj-notify-accent, #8d3f46);
  font-size: 10px;
  font-weight: 900;
  transform: scale(1.08);
  transform-origin: right bottom;
}

#kj-notifications-modal .kj-worker-filter.is-active.has-unread .kj-worker-filter-count {
  color: var(--kj-notify-accent-contrast, #fff);
}

#kj-notifications-modal .kj-worker-history {
  display: grid;
  gap: 8px;
}

/* Понятное состояние вместо бесконечного «Подключаем…», если конкретный
 * браузер заблокировал Worker или не завершил одноразовую привязку профиля. */
#kj-notifications-modal .kj-worker-connection-error {
  display: grid;
  justify-items: start;
  gap: 8px;
}

#kj-notifications-modal .kj-worker-retry {
  padding: 6px 11px;
  color: var(--kj-notify-accent-contrast, #fff);
  font: inherit;
  font-weight: 700;
  background: var(--kj-notify-accent, #8d3f46);
  border: 1px solid var(--kj-notify-accent, #8d3f46);
  border-radius: 4px;
  cursor: pointer;
}

#kj-notifications-modal .kj-worker-item {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 30px;
  gap: 10px;
  align-items: start;
  padding: 11px 10px;
  color: var(--kj-notify-text, #292929);
  background: var(--kj-notify-card, #fff);
  border: 1px solid var(--kj-notify-line, #d7d0c7);
  border-left: 4px solid var(--kj-notify-accent, #8d3f46);
  border-radius: 9px;
}

#kj-notifications-modal .kj-worker-item.is-read {
  opacity: .58;
  filter: saturate(.55);
  border-left-color: #aaa;
}

#kj-notifications-modal .kj-worker-item.is-unread {
  box-shadow: 0 5px 16px rgba(0, 0, 0, .09);
}

#kj-notifications-modal .kj-worker-icon,
#kj-worker-toast-stream .kj-worker-toast-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--kj-notify-accent-contrast, #fff);
  font-size: 17px;
  font-weight: 800;
  background: var(--kj-notify-accent, #8d3f46);
  border-radius: 50%;
}

#kj-notifications-modal .kj-worker-item[data-type="important"] .kj-worker-icon { background: #a96b1f; }
#kj-notifications-modal .kj-worker-item[data-type="subscription"] .kj-worker-icon { background: #477c6b; }
#kj-notifications-modal .kj-worker-item[data-type="mention"] .kj-worker-icon { background: #76518d; }
#kj-notifications-modal .kj-worker-item[data-type="quote"] .kj-worker-icon { background: #6d5d92; }
#kj-notifications-modal .kj-worker-item[data-type="reply"] .kj-worker-icon { background: #4a7086; }
#kj-notifications-modal .kj-worker-item[data-type="comment"] .kj-worker-icon { background: #9a5264; }
#kj-notifications-modal .kj-worker-item[data-type="like"] .kj-worker-icon { background: #a24b58; }
#kj-notifications-modal .kj-worker-item[data-type="private_message"] .kj-worker-icon { background: #58639a; }

#kj-notifications-modal .kj-worker-item-head {
  display: flex;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
}

#kj-notifications-modal .kj-worker-item-head time {
  flex: 0 0 auto;
  color: #777;
  font-size: 11px;
}

#kj-notifications-modal .kj-worker-item-copy {
  margin: 3px 0 5px;
}

#kj-notifications-modal .kj-worker-item-link {
  color: var(--kj-notify-link, #744047);
  font-weight: 700;
}

#kj-notifications-modal .kj-worker-read {
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--kj-notify-accent, #8d3f46);
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 50%;
  cursor: pointer;
}

#kj-notifications-modal .kj-worker-read[hidden] {
  visibility: hidden;
}

#kj-notifications-modal .kj-worker-panel[data-panel="settings"] h3 {
  margin: 4px 0 8px;
  font-size: 14px;
}

#kj-notifications-modal .kj-worker-settings-general {
  overflow: hidden;
  margin-bottom: 10px;
  border: 1px solid var(--kj-notify-line, #ddd);
  border-radius: 9px;
}

#kj-notifications-modal .kj-worker-setting-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  padding: 9px 10px;
  background: var(--kj-notify-card, #fff);
  border-bottom: 1px solid var(--kj-notify-line, #ddd);
  cursor: pointer;
}

#kj-notifications-modal .kj-worker-settings-general .kj-worker-setting-row:last-child {
  border-bottom: 0;
}

#kj-notifications-modal .kj-worker-setting-row small,
#kj-notifications-modal .kj-worker-setting-row strong {
  display: block;
}

#kj-notifications-modal .kj-worker-setting-row small {
  margin-top: 2px;
  color: #777;
}

#kj-notifications-modal .kj-worker-settings-help {
  margin: 10px 0 8px;
  color: #666;
  font-size: 12px;
}

#kj-notifications-modal .kj-worker-settings-matrix-wrap {
  overflow-x: auto;
  border: 1px solid var(--kj-notify-line, #d7d0c7);
  border-radius: 9px;
}

#kj-notifications-modal .kj-worker-settings-matrix {
  min-width: 540px;
  background: var(--kj-notify-card, #fff);
}

#kj-notifications-modal .kj-worker-settings-matrix-head,
#kj-notifications-modal .kj-worker-settings-matrix-row {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) repeat(3, 82px);
  align-items: stretch;
}

#kj-notifications-modal .kj-worker-settings-matrix-head {
  color: var(--kj-notify-accent-contrast, #fff);
  font-size: 11px;
  font-weight: 700;
  background: var(--kj-notify-accent, #8d3f46);
}

#kj-notifications-modal .kj-worker-settings-matrix-row {
  border-bottom: 1px solid var(--kj-notify-line, #ddd);
}

#kj-notifications-modal .kj-worker-settings-matrix-row:last-child {
  border-bottom: 0;
}

#kj-notifications-modal .kj-worker-settings-event,
#kj-notifications-modal .kj-worker-settings-channel,
#kj-notifications-modal .kj-worker-settings-cell {
  display: flex;
  gap: 7px;
  align-items: center;
  min-width: 0;
  padding: 8px 10px;
}

#kj-notifications-modal .kj-worker-settings-channel,
#kj-notifications-modal .kj-worker-settings-cell {
  justify-content: center;
  text-align: center;
  border-left: 1px solid rgba(127, 127, 127, .18);
}

#kj-notifications-modal .kj-worker-settings-channel {
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
}

#kj-notifications-modal .kj-worker-settings-event strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#kj-notifications-modal .kj-worker-settings-event-icon {
  display: grid;
  flex: 0 0 24px;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--kj-notify-accent-contrast, #fff);
  font-size: 12px;
  font-weight: 800;
  background: var(--kj-notify-accent, #8d3f46);
  border-radius: 50%;
}

#kj-notifications-modal .kj-worker-settings-cell {
  cursor: pointer;
}

/* Удаление журнала отделено от повседневных переключателей и оформлено как
 * второстепенное опасное действие, а не как ещё одна общая настройка. */
#kj-notifications-modal .kj-worker-history-danger {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 14px;
  align-items: center;
  margin-top: 14px;
  padding: 12px;
  color: var(--kj-notify-text, #292929);
  background: var(--kj-notify-card, #fff);
  border: 1px solid var(--kj-notify-line, #d7d0c7);
  border-radius: 9px;
}

#kj-notifications-modal .kj-worker-history-danger strong,
#kj-notifications-modal .kj-worker-history-danger p {
  display: block;
  margin: 0;
}

#kj-notifications-modal .kj-worker-history-danger p {
  margin-top: 2px;
  color: #777;
  font-size: 12px;
}

#kj-notifications-modal .kj-worker-clear-history {
  grid-column: 2;
  grid-row: 1;
  padding: 7px 11px;
  color: var(--kj-notify-accent, #8d3f46);
  font: inherit;
  font-weight: 700;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 7px;
  cursor: pointer;
}

#kj-notifications-modal .kj-worker-clear-history:hover,
#kj-notifications-modal .kj-worker-clear-history:focus-visible {
  color: var(--kj-notify-accent-contrast, #fff);
  background: var(--kj-notify-accent, #8d3f46);
}

#kj-notifications-modal .kj-worker-clear-history:disabled {
  opacity: .55;
  cursor: wait;
}

#kj-notifications-modal .kj-worker-clear-history-status {
  grid-column: 1 / -1;
  color: var(--kj-notify-accent, #8d3f46);
  font-size: 12px;
}

#kj-notifications-modal .kj-worker-clear-history-status:empty {
  display: none;
}

#kj-notifications-modal .kj-worker-settings-cell input,
#kj-notifications-modal .kj-worker-settings-channel input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--kj-notify-accent, #8d3f46);
  cursor: pointer;
}

#kj-notifications-modal .kj-worker-settings-cell input:disabled {
  cursor: not-allowed;
  opacity: .35;
}

#kj-worker-toast-stream {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 2147483000;
  display: grid;
  width: min(360px, calc(100vw - 36px));
  gap: 9px;
}

#kj-worker-toast-stream .kj-worker-toast {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 38px 12px 12px;
  color: var(--kj-notify-toast-text, #fff);
  background: var(--kj-notify-toast, #242424);
  border: 1px solid var(--kj-notify-accent, #a44e56);
  border-radius: 10px;
  box-shadow: 0 14px 35px rgba(0, 0, 0, .32);
}

#kj-worker-toast-stream .kj-worker-toast-body strong,
#kj-worker-toast-stream .kj-worker-toast-body span,
#kj-worker-toast-stream .kj-worker-toast-body a {
  display: block;
}

#kj-worker-toast-stream .kj-worker-toast-body a {
  margin-top: 5px;
  color: inherit;
  font-weight: 700;
}

#kj-worker-toast-stream .kj-worker-toast-close {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 24px;
  height: 24px;
  padding: 0;
  color: inherit;
  background: rgba(255, 255, 255, .12);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

@media (max-width: 640px) {
  #kj-notifications-modal .kj-worker-content { padding: 9px; }
  #kj-notifications-modal .kj-worker-filters { gap: 7px; }
  #kj-notifications-modal .kj-worker-filter { flex: 0 0 34px; width: 34px; height: 32px; }
  #kj-notifications-modal .kj-worker-item { grid-template-columns: 34px minmax(0, 1fr) 28px; }
  #kj-notifications-modal .kj-worker-item-head { display: block; }
  #kj-notifications-modal .kj-worker-item-head time { display: block; margin-top: 2px; }
  #kj-notifications-modal .kj-worker-history-danger { grid-template-columns: 1fr; }
  #kj-notifications-modal .kj-worker-clear-history { grid-column: 1; grid-row: auto; justify-self: start; }
  #kj-worker-toast-stream { right: 10px; bottom: 10px; width: calc(100vw - 20px); }
}
