.system-notification-button {
  position: relative;
}

.system-notification-modal,
.system-notification-modal .modal-header,
.system-notification-modal .modal-body,
.system-notification-modal .modal-footer {
  background: #fff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.system-notification-modal {
  height: min(680px, calc(100dvh - 36px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.system-notification-modal .modal-header,
.system-notification-modal .modal-footer {
  flex: 0 0 auto;
}

.system-notification-modal .modal-body {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.system-notification-backdrop {
  background: rgba(15, 23, 42, .72);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

:root[data-theme="dark"] .system-notification-modal,
:root[data-theme="dark"] .system-notification-modal .modal-header,
:root[data-theme="dark"] .system-notification-modal .modal-body,
:root[data-theme="dark"] .system-notification-modal .modal-footer {
  background: #0b1d34;
}

.system-notification-button .app-icon {
  width: 20px;
  height: 20px;
}

.system-notification-button [data-system-notification-badge] {
  position: absolute;
  inset-block-start: -6px;
  inset-inline-start: -7px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border: 2px solid var(--surface, #fff);
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
}

.system-notification-list {
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
  align-content: start;
  gap: 8px;
  max-height: none;
  overflow-y: auto;
  padding: 2px;
}

.browser-notification-permission {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid #9dd8cd;
  border-radius: 14px;
  background: #eef9f7;
}

.browser-notification-permission.blocked,
.browser-notification-permission.unavailable {
  border-color: #ebc47f;
  background: #fff7e8;
}

.browser-notification-permission-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: #009b84;
  color: #fff;
  font-weight: 800;
}

.blocked .browser-notification-permission-icon,
.unavailable .browser-notification-permission-icon {
  background: #d97706;
}

.browser-notification-permission > span:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.browser-notification-permission small {
  color: var(--text-muted, #52687a);
  line-height: 1.7;
}

.system-notification-item {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--border, #dbe4ec);
  border-radius: 14px;
  background: var(--surface, #fff);
  color: var(--text, #102a43);
  text-align: right;
  overflow: hidden;
}

.system-notification-item:hover,
.system-notification-item.unread {
  border-color: #75c8b9;
  background: #edf9f7;
}

:root[data-theme="dark"] .browser-notification-permission {
  border-color: #286c65;
  background: #103b38;
}

:root[data-theme="dark"] .browser-notification-permission.blocked,
:root[data-theme="dark"] .browser-notification-permission.unavailable {
  border-color: #715829;
  background: #392b12;
}

:root[data-theme="dark"] .system-notification-item:hover,
:root[data-theme="dark"] .system-notification-item.unread {
  border-color: #287f73;
  background: #103b38;
}

.system-notification-open {
  min-width: 0;
  width: 100%;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 10px;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: right;
}

.system-notification-delete {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #9f3a38;
  font-size: 21px;
  line-height: 1;
}

.system-notification-delete:hover {
  background: #fee2e2;
  color: #b91c1c;
}

.system-notification-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: #e8f1f7;
  color: #274c67;
  font-weight: 800;
}

.severity-warning .system-notification-icon { background: #fff3cd; color: #946200; }
.severity-critical .system-notification-icon { background: #fee2e2; color: #b91c1c; }
.severity-success .system-notification-icon { background: #dcfce7; color: #15803d; }

.system-notification-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.system-notification-copy strong { font-size: .95rem; }
.system-notification-copy > span { color: var(--text-muted, #52687a); line-height: 1.8; }
.system-notification-copy small { color: var(--text-muted, #718096); }
.system-notification-copy strong,
.system-notification-copy > span,
.system-notification-copy small {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.system-notification-unread {
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 50%;
  background: #009b84;
}

.system-notification-loading,
.system-notification-empty {
  padding: 32px 12px;
  text-align: center;
  color: var(--text-muted, #718096);
}

.mentioned-task-report { display: grid; gap: 14px; }
.mentioned-task-report header { padding-bottom: 12px; border-bottom: 1px solid var(--border, #dbe4ec); }
.mentioned-task-report header span, .mentioned-task-report header small { color: var(--text-muted, #718096); }
.mentioned-task-report header h3 { margin: 4px 0; }
.mentioned-task-report dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.mentioned-task-report dl div { padding: 10px; border-radius: 10px; background: var(--row-bg, #f7fafc); }
.mentioned-task-report dt { color: var(--text-muted, #718096); font-size: 11px; }
.mentioned-task-report dd { margin: 4px 0 0; font-weight: 700; }
.mentioned-task-report section { padding: 14px; border-inline-start: 3px solid #009b84; border-radius: 10px; background: rgba(0, 155, 132, .06); }
.mentioned-task-report section p { margin: 8px 0 0; white-space: pre-wrap; line-height: 1.9; }
.mentioned-task-report-attachments div { display: grid; gap: 8px; margin-top: 10px; }
.mentioned-task-report-attachments a {
  display: block;
  max-width: 100%;
  padding: 9px 11px;
  border: 1px solid rgba(0, 155, 132, .28);
  border-radius: 9px;
  background: var(--surface, #fff);
  color: #007d6b;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 640px) {
  .mentioned-task-report dl { grid-template-columns: 1fr; }
  .browser-notification-permission {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .browser-notification-permission button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .system-notification-item {
    grid-template-columns: minmax(0, 1fr) 32px;
  }

  .system-notification-open {
    grid-template-columns: 34px minmax(0, 1fr) 8px;
    gap: 9px;
    padding: 12px;
  }
}
