.notifications-page {
  width: 100%;
  min-width: 0;
}

.notifications-page .notifications-panel {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.notifications-page .notification-journal-toolbar {
  display: flex;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
}

.notifications-page .notification-journal-filters {
  display: grid;
  flex: 1 1 620px;
  grid-template-columns: minmax(240px, 1fr) minmax(130px, 0.45fr) minmax(160px, 0.55fr);
  gap: 6px;
  min-width: 0;
  margin: 0;
}

.notifications-page .notification-journal-filters input,
.notifications-page .notification-journal-filters select {
  width: 100%;
  min-height: 36px;
  padding-block: 6px;
}

.notifications-page .notification-journal-filters input[type="search"] {
  grid-column: auto;
}

.notifications-page .notification-filter-summary {
  min-height: 20px;
  margin: 0;
  font-size: 11px;
}

.notifications-page .notification-journal-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 500px), 1fr));
  align-items: start;
  gap: 8px;
  min-width: 0;
}

.notifications-page .notification-journal-section {
  display: grid;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.notifications-page .notification-journal-section > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 7px 11px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--soft-panel) 74%, transparent);
}

.notifications-page .notification-journal-section > header h2 {
  margin: 0;
  font-size: 15px;
  line-height: 1.2;
}

.notifications-page .notification-journal-section-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.notifications-page .notification-journal-section-stats strong {
  padding: 2px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  font-size: inherit;
}

.notifications-page .notification-journal-view-all {
  width: auto;
  min-width: 0;
  min-height: 28px;
  padding: 4px 8px;
  font-size: 11px;
  white-space: nowrap;
}

.notifications-page .notification-journal-section .notification-list {
  display: grid;
  gap: 0;
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.notifications-page .notification-journal-section .notification-journal-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid color-mix(in srgb, var(--muted) 35%, transparent);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
}

.notifications-page .notification-journal-section .notification-journal-item:last-child {
  border-bottom: 0;
}

.notifications-page .notification-journal-section .notification-journal-item:hover {
  background: color-mix(in srgb, var(--accent) 5%, transparent);
  transform: none;
}

.notifications-page .notification-journal-section .notification-journal-item.unread {
  border-color: var(--line);
  border-left-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.notifications-page .notification-journal-section .notification-journal-item.is-warning,
.notifications-page .notification-journal-section .notification-journal-item.is-warn {
  border-left-color: var(--warning, #f59e0b);
}

.notifications-page .notification-journal-section .notification-journal-item.is-danger,
.notifications-page .notification-journal-section .notification-journal-item.is-error,
.notifications-page .notification-journal-section .notification-journal-item.is-critical {
  border-left-color: var(--danger, #ef4444);
}

.notifications-page .notification-journal-section .notification-journal-item > .notification-content-button {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  white-space: normal;
}

.layout.app-shell #mainContent .page-layout.notifications-page .notification-journal-item > .notification-content-button {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.notifications-page .notification-journal-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 8px;
}

.notifications-page .notification-journal-heading .notification-title {
  min-width: 0;
  font-size: 14px;
  line-height: 1.25;
}

.notifications-page .notification-journal-heading .notification-time {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.notifications-page .notification-journal-item .notification-message {
  display: -webkit-box;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.notifications-page .notification-journal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 10px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.notifications-page .notification-journal-meta strong {
  color: var(--text);
  font-size: inherit;
}

.notifications-page .notification-journal-state {
  padding: 1px 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 12%, transparent);
  font-weight: 800;
}

.notifications-page .notification-journal-state.is-unread {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
}

.notifications-page .notification-journal-item .notification-actions {
  display: flex;
  justify-content: flex-end;
}

.notifications-page .notification-journal-item .notification-journal-open {
  width: auto;
  min-width: 0;
  min-height: 30px;
  padding: 5px 9px;
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  color: var(--accent);
  font-size: 11px;
  white-space: nowrap;
}

.layout.app-shell #mainContent .page-layout.notifications-page .notification-journal-item .notification-journal-open {
  width: auto;
  min-width: 0;
  min-height: 30px;
  padding: 5px 9px;
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: transparent;
  color: var(--accent);
  font-size: 11px;
  white-space: nowrap;
}

#siteModalHost #modal:has(.notification-journal-dialog) {
  width: min(920px, calc(100dvw - 48px));
  margin: auto;
}

.notification-journal-dialog {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.notification-journal-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.notification-journal-dialog-header > div {
  min-width: 0;
}

.notification-journal-dialog-header :is(h2, p) {
  margin: 0;
}

.notification-journal-dialog-header h2 {
  margin-top: 2px;
}

.notification-journal-dialog-header > div > p:last-child {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.notification-journal-dialog-header > button {
  flex: 0 0 auto;
}

.notifications-page.notification-journal-dialog .notification-journal-modal-list {
  max-height: min(620px, 62dvh);
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 4px;
}

@media (max-width: 1100px) {
  .notifications-page .notification-journal-toolbar {
    flex-wrap: wrap;
  }

  .notifications-page .notification-journal-filters {
    flex-basis: 100%;
  }
}

@media (max-width: 680px) {
  .notifications-page .notification-journal-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .notifications-page .notification-journal-filters input[type="search"] {
    grid-column: 1 / -1;
  }

  .notifications-page .notification-journal-section .notification-journal-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    padding: 7px 8px;
  }

  .notifications-page .notification-journal-item .notification-actions {
    justify-content: flex-start;
  }

  .notifications-page .notification-journal-item .notification-journal-open {
    width: auto;
  }

  .notification-journal-dialog-header {
    gap: 10px;
  }
}

@media (max-width: 420px) {
  .notifications-page .notification-journal-section > header {
    align-items: flex-start;
  }

  .notifications-page .notification-journal-section-stats {
    align-items: flex-end;
    flex-direction: column;
    gap: 3px;
  }

  .notifications-page .notification-journal-heading {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
}
