.ui2-alert-overlay {
  background: rgba(0, 0, 0, 0.48);
  inset: 0;
  position: fixed;
  z-index: 130;
}

.ui2-alert-overlay[hidden] {
  display: none;
}

.ui2-alert-drawer {
  background: var(--ui2-sidebar);
  border-left: 1px solid var(--ui2-border);
  bottom: 0;
  box-shadow: -24px 0 70px rgba(0, 0, 0, 0.32);
  display: flex;
  flex-direction: column;
  max-width: 92vw;
  position: fixed;
  right: 0;
  top: 0;
  transform: translateX(105%);
  transition: transform 0.2s var(--app-ease);
  width: 410px;
  z-index: 140;
}

.ui2-alert-drawer.open {
  transform: translateX(0);
}

.ui2-alert-drawer > header {
  align-items: center;
  border-bottom: 1px solid var(--ui2-border);
  display: flex;
  min-height: 76px;
  padding: 14px 16px;
}

.ui2-alert-drawer > header > div {
  flex: 1;
  min-width: 0;
}

.ui2-alert-drawer > header strong,
.ui2-alert-drawer > header small {
  display: block;
}

.ui2-alert-drawer > header strong {
  color: var(--ui2-text);
  font-size: 14px;
}

.ui2-alert-drawer > header small {
  color: var(--ui2-muted);
  font-size: 10px;
  margin-top: 4px;
}

.ui2-alert-tabs {
  border-bottom: 1px solid var(--ui2-border);
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 9px 12px;
}

.ui2-alert-tabs button {
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: var(--ui2-muted);
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  min-height: 32px;
  padding: 0 9px;
  white-space: nowrap;
}

.ui2-alert-tabs button:hover,
.ui2-alert-tabs button.active {
  background: var(--ui2-surface);
  color: var(--ui2-text);
}

.ui2-alert-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 12px 18px;
}

.ui2-alert-card {
  border-bottom: 1px solid var(--ui2-border);
  padding: 4px 0;
}

.ui2-alert-card[hidden] {
  display: none;
}

.ui2-alert-card > summary {
  border-radius: 9px;
  color: var(--ui2-text);
  cursor: pointer;
  display: grid;
  gap: 4px;
  grid-template-columns: 8px minmax(0, 1fr);
  list-style: none;
  min-height: 62px;
  padding: 10px 9px;
}

.ui2-alert-card > summary::-webkit-details-marker {
  display: none;
}

.ui2-alert-card > summary:hover,
.ui2-alert-card[open] > summary {
  background: var(--ui2-surface);
}

.ui2-alert-card-dot {
  background: var(--ui2-muted);
  border-radius: 50%;
  height: 7px;
  margin-top: 5px;
  width: 7px;
}

.ui2-alert-card.is-unread .ui2-alert-card-dot,
.ui2-alert-card.priority-urgente .ui2-alert-card-dot {
  background: var(--ui2-red);
}

.ui2-alert-card.priority-atencao .ui2-alert-card-dot {
  background: var(--warning);
}

.ui2-alert-card-title {
  display: block;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.ui2-alert-card-meta {
  color: var(--ui2-muted);
  display: block;
  font-size: 9px;
  margin-top: 4px;
}

.ui2-alert-card-body {
  color: var(--ui2-text);
  font-size: 11px;
  line-height: 1.55;
  padding: 4px 18px 14px 26px;
  white-space: pre-wrap;
}

.ui2-alert-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.ui2-alert-card-actions a,
.ui2-alert-card-actions button {
  align-items: center;
  background: var(--ui2-surface-strong);
  border: 1px solid var(--ui2-border);
  border-radius: 7px;
  color: var(--ui2-text);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 10px;
  min-height: 32px;
  padding: 0 9px;
  text-decoration: none;
}

.ui2-alert-card-actions button.is-primary {
  background: var(--ui2-red);
  border-color: var(--ui2-red);
  color: #fff;
}

.ui2-alert-empty {
  color: var(--ui2-muted);
  font-size: 11px;
  padding: 36px 12px;
  text-align: center;
}

.ui2-alert-drawer > footer {
  border-top: 1px solid var(--ui2-border);
  padding: 12px;
}

.ui2-alert-drawer > footer a {
  align-items: center;
  background: var(--ui2-surface);
  border: 1px solid var(--ui2-border);
  border-radius: 8px;
  color: var(--ui2-text);
  display: flex;
  font-size: 11px;
  justify-content: center;
  min-height: 38px;
  text-decoration: none;
}

.alerts-admin-page {
  font-family: 'DM Sans', sans-serif;
  margin: 0 auto;
  max-width: 1500px;
}

.alerts-compose-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.alerts-draft { color: var(--app-text-muted); font-size: .78rem; }

.alerts-admin-heading {
  margin-bottom: 22px;
}

.alerts-admin-heading span {
  color: var(--muted);
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.alerts-admin-heading h1 {
  font-family: 'DM Sans', sans-serif;
  font-size: 24px;
  font-weight: 700;
}

.alerts-admin-heading p,
.alerts-section-title p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 5px;
}

.alerts-admin-layout {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
}

.alerts-admin-layout.is-single {
  grid-template-columns: minmax(0, 900px);
}

.alerts-compose,
.alerts-history {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.alerts-section-title {
  margin-bottom: 17px;
}

.alerts-section-title h2 {
  font-size: 16px;
}

.alerts-compose > .form-label,
.alerts-fields-grid .form-label {
  display: block;
  margin-bottom: 14px;
}

.alerts-compose .form-control {
  margin-top: 6px;
  width: 100%;
}

.alerts-compose textarea {
  min-height: 128px;
  resize: vertical;
}

.alerts-message-field > span { display: block; margin-bottom: 6px; }
.alerts-editor { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.alerts-editor-toolbar { align-items: center; background: var(--surface2); border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; }
.alerts-editor-toolbar button { align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 7px; color: var(--text); cursor: pointer; display: inline-flex; font: inherit; font-size: 11px; gap: 4px; justify-content: center; min-height: 34px; padding: 0 10px; }
.alerts-editor-toolbar button:hover { border-color: var(--ui2-red-border); color: var(--ui2-red); }
.alerts-editor-toolbar button[aria-pressed="true"] { background: var(--ui2-red-soft); border-color: var(--ui2-red-border); color: var(--ui2-red); }
.alerts-toolbar-divider { align-self: stretch; border-left: 1px solid var(--border); margin: 2px 3px; }
.alerts-toolbar-group { display: flex; flex-wrap: wrap; gap: 6px; }
.alerts-editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .8fr); }
.alerts-editor-grid > div { min-width: 0; padding: 12px; }
.alerts-editor-grid > div + div { border-left: 1px solid var(--border); }
.alerts-editor .form-control { margin: 0; min-height: 230px; }
.alerts-editor-meta { color: var(--muted); display: flex; font-size: 10px; gap: 12px; justify-content: space-between; margin-top: 7px; }
.alerts-editor-preview > strong { color: var(--muted); display: block; font-size: 10px; letter-spacing: .05em; margin-bottom: 12px; text-transform: uppercase; }
.alerts-editor-preview .alert-message-content { letter-spacing: normal; text-transform: none; }
.alerts-editor-error { color: var(--danger); font-size: 11px; margin: 0; padding: 0 12px 12px; }

.alerts-fields-grid {
  display: grid;
  gap: 0 12px;
  grid-template-columns: 1fr 1fr;
}

.alerts-audience {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 2px 0 15px;
  padding: 14px;
}

.alerts-audience legend {
  font-size: 12px;
  font-weight: 800;
  padding: 0 6px;
}

.alerts-audience details {
  border-top: 1px solid var(--border);
  margin-top: 10px;
  padding-top: 10px;
}

.alerts-audience summary {
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 10px;
}

.alerts-option-grid {
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.alerts-users-grid {
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.alerts-users-grid [hidden] { display: none; }

.alerts-user-search {
  display: block;
  margin-bottom: 6px;
}

.alerts-user-search > span,
.alerts-recipient-toolbar label > span {
  color: var(--muted);
  display: block;
  font-size: 10px;
  font-weight: 700;
  margin-bottom: 5px;
}

.alerts-user-search .form-control {
  margin-top: 0;
}

.alerts-user-search-status,
.alerts-user-search-empty {
  color: var(--muted);
  font-size: 10px;
  margin: 6px 0 10px;
}

.alerts-user-search-empty {
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 14px;
  text-align: center;
}

.alerts-check {
  align-items: center;
  color: var(--text);
  display: flex;
  font-size: 11px;
  gap: 8px;
  min-height: 34px;
}

.alerts-check input {
  accent-color: var(--accent);
  flex: 0 0 auto;
}

.alerts-check span {
  min-width: 0;
}

.alerts-check small {
  color: var(--muted);
  display: block;
  font-size: 9px;
  margin-top: 2px;
}

.alerts-check-primary {
  font-weight: 700;
}

.alerts-audience-summary {
  color: var(--muted);
  font-size: 10px;
  margin-top: 11px;
}

.alerts-history-list {
  display: grid;
  gap: 10px;
}

.alerts-history-list article {
  border-bottom: 1px solid var(--border);
  padding: 2px 0 14px;
}

.alerts-history-head {
  align-items: start;
  display: flex;
  gap: 8px;
}

.alerts-history-head strong {
  flex: 1;
  font-size: 12px;
}

.alerts-history-list article > p {
  color: var(--muted);
  font-size: 10px;
  margin: 5px 0 8px;
}

.alerts-priority,
.alerts-cancelled {
  border-radius: 999px;
  font-size: 9px;
  padding: 3px 7px;
  text-transform: capitalize;
}

.alerts-priority-informativo {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
}

.alerts-priority-atencao {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
}

.alerts-priority-urgente {
  background: rgba(239, 68, 68, 0.13);
  color: #f87171;
}

.alerts-history-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 9px;
}

.alerts-history-stats span,
.alerts-cancelled {
  background: var(--surface2);
  color: var(--muted);
  font-size: 9px;
  padding: 4px 7px;
}

.alerts-history-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.alerts-history-actions form { margin: 0; }

.alerts-history-dialog {
  background: transparent;
  border: 0;
  color: var(--text);
  height: fit-content;
  inset: 0;
  margin: auto;
  max-height: min(86dvh, 780px);
  max-width: none;
  padding: 0;
  position: fixed;
  width: min(1120px, calc(100vw - 64px));
}

.alerts-history-dialog::backdrop {
  backdrop-filter: blur(3px);
  background: rgba(3, 8, 15, 0.76);
}

.alerts-history-dialog-shell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.46);
  display: flex;
  flex-direction: column;
  height: auto;
  max-height: min(86dvh, 780px);
  overflow: hidden;
}

.alerts-history-dialog-shell > header {
  align-items: center;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 18px 22px;
}

.alerts-history-dialog-shell > header span {
  color: var(--accent);
  display: block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.alerts-history-dialog-shell > header h2 { font-size: 20px; margin-top: 3px; }
.alerts-history-dialog-shell > header button { font-size: 22px; }

.alerts-history-dialog-body {
  flex: 1;
  max-height: calc(min(86dvh, 780px) - 78px);
  min-height: 0;
  overflow-y: auto;
  padding: 20px 22px 18px;
}

.alerts-history-loading,
.alerts-history-error {
  color: var(--muted);
  padding: 36px 10px;
  text-align: center;
}

.alerts-history-error { color: var(--danger); }

.alerts-history-overview {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(230px, .36fr);
  margin-bottom: 16px;
}

.alerts-history-message,
.alerts-history-metrics {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 16px;
}

.alerts-history-message > p { color: var(--muted); font-size: 11px; margin: 9px 0 14px; }
.alerts-history-message > div[data-history-message] { font-size: 13px; line-height: 1.65; max-width: 76ch; overflow-wrap: anywhere; }

.alerts-history-audiences { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 15px; }
.alerts-history-audiences span { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-size: 9px; padding: 5px 8px; }

.alerts-history-metrics { display: grid; gap: 8px; }
.alerts-history-metrics div { align-items: baseline; border-bottom: 1px solid var(--border); display: flex; gap: 8px; justify-content: space-between; padding-bottom: 8px; }
.alerts-history-metrics div:last-child { border-bottom: 0; padding-bottom: 0; }
.alerts-history-metrics strong { color: var(--text); font-size: 18px; }
.alerts-history-metrics span { color: var(--muted); font-size: 10px; text-align: right; }

.alerts-recipient-toolbar {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, .4fr);
  margin-bottom: 10px;
}

.alerts-recipient-result { color: var(--muted); font-size: 10px; margin: 7px 0 10px; }

.alerts-recipient-list {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.alerts-recipient-row {
  align-items: center;
  border-top: 1px solid var(--border);
  display: grid;
  font-size: 11px;
  gap: 12px;
  grid-template-columns: minmax(150px, 1.2fr) minmax(100px, .8fr) minmax(120px, .8fr) minmax(120px, .8fr);
  padding: 11px 13px;
}

.alerts-recipient-row:first-child { border-top: 0; }
.alerts-recipient-row.is-head { background: var(--surface2); color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.alerts-recipient-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alerts-recipient-row small { color: var(--muted); font-size: 10px; }
.alerts-recipient-empty { color: var(--muted); font-size: 11px; padding: 28px 14px; text-align: center; }

.alerts-recipient-state { align-items: center; display: inline-flex; font-size: 10px; gap: 6px; }
.alerts-recipient-state::before { background: var(--muted); border-radius: 50%; content: ""; height: 6px; width: 6px; }
.alerts-recipient-state.is-read::before { background: #60a5fa; }
.alerts-recipient-state.is-confirmed::before { background: var(--success); }

.alerts-recipient-pagination { align-items: center; display: flex; gap: 10px; justify-content: flex-end; margin-top: 10px; }
.alerts-recipient-pagination span { color: var(--muted); font-size: 10px; }

/* Indicadores globais: animação curta e discreta somente quando há novidade. */
.ui2-alert-button.has-unread,
.ui2-alert-nav.has-unread {
  border-color: var(--ui2-red-border);
  color: var(--ui2-text);
}

.ui2-alert-button.has-unread svg,
.ui2-alert-nav.has-unread .ui2-nav-icon svg {
  animation: ui2-bell-ring 3.8s ease-in-out infinite;
  color: var(--ui2-red);
  transform-origin: 50% 12%;
}

.ui2-alert-button.has-urgent,
.ui2-alert-nav.has-urgent {
  background: var(--ui2-red-soft);
  box-shadow: 0 0 0 1px var(--ui2-red-border), 0 0 24px rgba(237, 49, 58, 0.12);
}

.ui2-alert-nav {
  grid-template-columns: 28px minmax(0, 1fr) auto;
}

.ui2-nav-badge {
  align-items: center;
  background: var(--ui2-red);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 8px;
  height: 17px;
  justify-content: center;
  min-width: 17px;
  padding: 0 5px;
}

.ui2-nav-badge[hidden] { display: none; }

@keyframes ui2-bell-ring {
  0%, 88%, 100% { transform: rotate(0); }
  91% { transform: rotate(14deg); }
  94% { transform: rotate(-12deg); }
  97% { transform: rotate(7deg); }
}

.alerts-audience.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.alerts-audience-error {
  color: #f87171;
  font-size: 11px;
  font-weight: 700;
  margin-top: 8px;
}

.alerts-audience-error[hidden] { display: none; }

.alerts-center {
  display: grid;
  font-family: 'DM Sans', sans-serif;
  gap: 20px;
  margin: 0 auto;
  max-width: 1500px;
}

.alerts-center-heading {
  align-items: flex-end;
  display: flex;
  gap: 20px;
  justify-content: space-between;
}

.alerts-center-heading > div:first-child > span {
  color: var(--ui2-red);
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.alerts-center-heading h1 {
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(25px, 4vw, 34px);
  font-weight: 700;
}

.alerts-center-heading p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}

.alerts-center-heading-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.alerts-mark-all {
  height: 40px;
  min-height: 40px;
  padding: 0 14px;
  white-space: nowrap;
}

.alerts-mark-all[hidden] { display: none; }

.alerts-bulk-feedback {
  background: color-mix(in srgb, var(--warning) 12%, var(--app-card));
  border: 1px solid color-mix(in srgb, var(--warning) 42%, var(--border));
  border-radius: 10px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
  padding: 11px 14px;
}

.alerts-bulk-feedback[hidden] { display: none; }

.alerts-center-summary {
  align-items: center;
  background: var(--app-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  white-space: nowrap;
}

.alerts-center-summary strong { color: var(--ui2-red); font-size: 16px; font-variant-numeric: tabular-nums; line-height: 1; }
.alerts-center-summary span { color: var(--muted); font-size: 11px; line-height: 1.2; }
.alerts-center-summary.is-empty { align-items: flex-start; flex-direction: column; gap: 2px; justify-content: center; }
.alerts-center-summary.is-empty strong { color: var(--success); font-size: 12px; }
.alerts-center-summary.is-empty span { font-size: 10px; }

.alerts-center-layout {
  align-items: stretch;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(300px, 0.38fr) minmax(0, 0.62fr);
  min-height: 460px;
}

.alerts-center-list,
.alerts-center-detail {
  background: var(--app-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  min-width: 0;
}

.alerts-center-list {
  max-height: calc(100vh - 190px);
  overflow-y: auto;
  padding: 9px;
}

.alerts-center-list-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding: 10px 10px 13px;
}

.alerts-center-list-head strong { color: var(--text); font-size: 13px; }
.alerts-center-list-head span { color: var(--muted); font-size: 9px; }

.alerts-center-item {
  align-items: start;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text);
  display: grid;
  gap: 9px;
  grid-template-columns: 7px minmax(0, 1fr) auto;
  margin-bottom: 4px;
  min-height: 70px;
  padding: 11px;
  text-decoration: none;
}

.alerts-center-item:hover,
.alerts-center-item.active {
  background: var(--app-card2);
  border-color: var(--border);
}

.alerts-center-item.active {
  background: linear-gradient(90deg, var(--ui2-red-soft), var(--app-card2) 42%);
  border-color: var(--ui2-red-border);
  box-shadow: inset 3px 0 0 var(--ui2-red);
}
.alerts-center-item.active strong { color: var(--ui2-text); }
.alerts-center-item > i { background: var(--muted); border-radius: 50%; height: 7px; margin-top: 5px; width: 7px; }
.alerts-center-item.priority-atencao > i { background: var(--warning); }
.alerts-center-item.priority-urgente > i,
.alerts-center-item.is-unread > i { background: var(--ui2-red); }
.alerts-center-item span { min-width: 0; }
.alerts-center-item strong { display: block; font-size: 12px; line-height: 1.35; }
.alerts-center-item small { color: var(--muted); display: block; font-size: 10px; line-height: 1.4; margin-top: 5px; }
.alerts-center-item > b { background: var(--ui2-red-soft); border-radius: 999px; color: var(--ui2-red); font-size: 8px; padding: 3px 6px; text-transform: uppercase; }

.alerts-center-detail {
  display: flex;
  flex-direction: column;
  padding: clamp(22px, 4vw, 48px);
}

.alerts-detail-back { align-items: center; color: var(--muted); display: none; font-size: 12px; font-weight: 700; gap: 7px; margin-bottom: 20px; text-decoration: none; width: fit-content; }
.alerts-detail-back:hover { color: var(--text); }
.alerts-detail-back svg { height: 16px; transform: rotate(180deg); width: 16px; }
.alerts-detail-kicker { align-items: center; color: var(--muted); display: flex; font-size: 11px; gap: 8px; }
.alerts-center-detail h2 { color: var(--text); font-family: 'DM Sans', sans-serif; font-size: clamp(24px, 3.5vw, 38px); font-weight: 700; line-height: 1.15; margin-top: 18px; }
.alerts-detail-meta { border-bottom: 1px solid var(--border); color: var(--muted); font-size: 11px; line-height: 1.5; margin-top: 12px; padding-bottom: 20px; }
.alerts-detail-message { color: var(--text); font-size: 14px; line-height: 1.75; max-width: 76ch; overflow-wrap: anywhere; padding: 24px 0 0; }
.alert-message-content p { margin: 0 0 12px; }
.alert-message-content p:last-child { margin-bottom: 0; }
.alert-message-content h3 { color: var(--text); font-size: 18px; line-height: 1.35; margin: 22px 0 9px; }
.alert-message-content h4 { color: var(--text); font-size: 15px; line-height: 1.4; margin: 18px 0 8px; }
.alert-message-content h3:first-child,
.alert-message-content h4:first-child { margin-top: 0; }
.alert-message-content ul,
.alert-message-content ol { margin: 8px 0 15px; padding-left: 22px; }
.alert-message-content li { margin: 5px 0; }
.alert-message-content blockquote { background: var(--surface2); border-left: 3px solid var(--ui2-red); border-radius: 0 8px 8px 0; color: var(--text); margin: 14px 0; padding: 11px 14px; }
.alert-message-content a { color: var(--ui2-red); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.alert-message-content .alert-align-left { text-align: left; }
.alert-message-content .alert-align-center { text-align: center; }
.alert-message-content .alert-align-right { text-align: right; }
.alert-message-content .alert-align-justify { hyphens: auto; text-align: justify; text-align-last: left; }
.alerts-detail-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; padding-top: 0; }
.alerts-confirmed { color: var(--success); font-size: 12px; font-weight: 700; }

.alerts-detail-placeholder,
.alerts-center-empty {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.alerts-detail-placeholder svg,
.alerts-center-empty svg { color: var(--ui2-red); height: 34px; margin-bottom: 14px; width: 34px; }
.alerts-detail-placeholder h2 { font-size: 20px; margin: 0; }
.alerts-detail-placeholder p { font-size: 11px; line-height: 1.6; margin-top: 8px; max-width: 380px; }
.alerts-center-empty { min-height: 260px; }
.alerts-center-empty strong { color: var(--text); font-size: 13px; }
.alerts-center-empty span { font-size: 10px; margin-top: 5px; }

@media (max-width: 980px) {
  .alerts-admin-layout {
    grid-template-columns: 1fr;
  }

  .alerts-center-layout { grid-template-columns: 1fr; min-height: 0; }
  .alerts-center-list { max-height: 390px; }
  .alerts-center-detail { min-height: 400px; }
  .alerts-history-overview { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .alerts-center.has-selection .alerts-center-list { display: none; }
  .alerts-center:not(.has-selection) .alerts-center-detail { display: none; }
  .alerts-center.has-selection .alerts-detail-back { display: inline-flex; }
}

@media (max-width: 620px) {
  .ui2-alert-drawer {
    max-width: none;
    width: 100%;
  }

  .alerts-compose,
  .alerts-history {
    padding: 15px;
  }

  .alerts-fields-grid,
  .alerts-option-grid,
  .alerts-recipient-toolbar {
    grid-template-columns: 1fr;
  }

  .alerts-editor-grid { grid-template-columns: 1fr; }
  .alerts-editor-grid > div + div { border-left: 0; border-top: 1px solid var(--border); }

  .alerts-history-dialog { height: 100dvh; inset: 0; margin: 0; max-height: none; width: 100vw; }
  .alerts-history-dialog-shell { border: 0; border-radius: 0; height: 100%; max-height: none; }
  .alerts-history-dialog-body { max-height: none; padding: 15px; }
  .alerts-recipient-row { align-items: start; gap: 6px; grid-template-columns: 1fr 1fr; }
  .alerts-recipient-row.is-head { display: none; }
  .alerts-recipient-row strong { grid-column: 1 / -1; }
  .alerts-recipient-pagination { justify-content: space-between; }

  .alerts-center-heading { align-items: flex-start; flex-direction: column; }
  .alerts-center-heading-actions { align-items: stretch; flex-direction: column; width: 100%; }
  .alerts-mark-all { width: 100%; }
  .alerts-center-summary { align-self: stretch; justify-content: center; }
  .alerts-center-list { max-height: none; }
  .alerts-center-detail { min-height: 360px; padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .ui2-alert-button.has-unread svg,
  .ui2-alert-nav.has-unread .ui2-nav-icon svg { animation: none; }
}
