.notifications-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 16px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.notifications-hero > p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.55;
}

.notifications-hero-state {
  min-width: 205px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.notifications-hero-state > span:last-child {
  display: grid;
  gap: 2px;
}

.notifications-hero-state small {
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.notifications-hero-state strong {
  color: var(--heading-color);
  font-size: 0.84rem;
}

.notification-state-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #9aa3ad;
  box-shadow: 0 0 0 5px color-mix(in srgb, #9aa3ad 14%, transparent);
}

.notification-state-dot.active {
  background: #25845b;
  box-shadow: 0 0 0 5px color-mix(in srgb, #25845b 15%, transparent);
}

.notification-state-dot.action-required {
  background: #b7791f;
  box-shadow: 0 0 0 5px color-mix(in srgb, #b7791f 15%, transparent);
}

.notifications-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(290px, 0.75fr);
  gap: 16px;
  align-items: start;
}

.notifications-primary,
.notifications-secondary {
  display: grid;
  gap: 16px;
}

.notification-recipient-panel,
.notification-catalog-panel,
.notification-channel-card,
.notification-history-panel {
  overflow: hidden;
}

.notification-panel-heading {
  align-items: start;
}

.notification-panel-heading p:last-child {
  max-width: 680px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.notification-count {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--heading-color);
  background: color-mix(in srgb, var(--brand-gold-light) 23%, var(--surface));
  font-size: 0.68rem;
  font-weight: 750;
}

.notification-recipient-editor {
  display: grid;
  gap: 12px;
  padding: 4px 18px 0;
}

.notification-recipient-chips {
  min-height: 48px;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  gap: 7px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.notification-recipient-chips:empty::before {
  content: "No recipients saved yet";
  align-self: center;
  padding-left: 3px;
  color: var(--muted);
  font-size: 0.75rem;
}

.notification-recipient-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 6px 7px 6px 10px;
  border: 1px solid color-mix(in srgb, var(--brand-gold) 28%, var(--line));
  border-radius: 999px;
  color: var(--heading-color);
  background: color-mix(in srgb, var(--brand-gold-light) 12%, var(--surface));
  font-size: 0.72rem;
  font-weight: 700;
}

.notification-recipient-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.notification-recipient-chip button {
  width: 20px;
  height: 20px;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  font-size: 1rem;
  line-height: 1;
}

.notification-recipient-chip button:hover,
.notification-recipient-chip button:focus-visible {
  color: #9e2e27;
  background: color-mix(in srgb, #b42318 10%, transparent);
}

.notification-recipient-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.notification-recipient-entry input {
  width: 100%;
}

.notification-form-help {
  margin: 8px 18px 0;
  color: var(--muted);
  font-size: 0.7rem;
}

.notification-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 18px 18px;
}

.notification-alert-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 18px 18px;
}

.notification-alert-card {
  min-height: 164px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 7px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.notification-alert-card.active {
  border-color: color-mix(in srgb, #25845b 36%, var(--line));
  background: linear-gradient(145deg, color-mix(in srgb, #25845b 5%, var(--surface)), var(--surface));
}

.notification-alert-card h3 {
  margin: 0;
  color: var(--heading-color);
  font-size: 0.9rem;
}

.notification-alert-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.5;
}

.notification-alert-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 5px;
  border-top: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  color: var(--muted);
  font-size: 0.66rem;
}

.notification-state-badge {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 999px;
  color: #59626d;
  background: #eef0f3;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.notification-state-badge.active,
.notification-event-outcome.sent {
  color: #176743;
  background: #e7f5ed;
}

.notification-state-badge.action-required,
.notification-event-outcome.failed {
  color: #925f10;
  background: #fff3d6;
}

.notification-state-badge.planned,
.notification-event-outcome.settings-changed {
  color: #59626d;
  background: #eef0f3;
}

.notification-channel-card {
  display: grid;
  gap: 9px;
  padding: 20px;
}

.notification-channel-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  margin-bottom: 3px;
  border-radius: 10px;
  color: var(--heading-color);
  background: var(--gold-gradient);
  font-size: 1rem;
  font-weight: 900;
}

.notification-channel-card h2 {
  margin: 2px 0 0;
}

.notification-channel-details {
  display: grid;
  gap: 0;
  margin: 9px 0 0;
}

.notification-channel-details div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  font-size: 0.69rem;
}

.notification-channel-details dt {
  color: var(--muted);
}

.notification-channel-details dd {
  margin: 0;
  color: var(--heading-color);
  text-align: right;
  font-weight: 650;
}

.notification-privacy-note {
  margin: 2px 0 0;
  padding: 10px 11px;
  border-radius: 6px;
  color: #4c5966;
  background: var(--surface-soft);
  font-size: 0.67rem;
  line-height: 1.45;
}

.notification-history-panel .panel-heading {
  padding-bottom: 8px;
}

.notification-history {
  display: grid;
  padding: 0 18px 14px;
}

.notification-history-empty {
  margin: 2px 0 4px;
  padding: 18px 8px;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
}

.notification-history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.notification-history-item:last-child {
  border-bottom: 0;
}

.notification-history-item strong {
  overflow-wrap: anywhere;
  color: var(--heading-color);
  font-size: 0.7rem;
}

.notification-history-item small {
  color: var(--muted);
  font-size: 0.63rem;
}

.notification-event-outcome {
  align-self: start;
  padding: 4px 6px;
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
}

@media (max-width: 1180px) {
  .notifications-layout {
    grid-template-columns: 1fr;
  }

  .notification-channel-card {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
  }

  .notification-channel-icon {
    margin: 0;
  }

  .notification-channel-details,
  .notification-privacy-note {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .notifications-hero {
    align-items: stretch;
    flex-direction: column;
    padding: 20px;
  }

  .notifications-hero-state {
    min-width: 0;
  }

  .notification-alert-grid,
  .notification-channel-card {
    grid-template-columns: 1fr;
  }

  .notification-channel-details,
  .notification-privacy-note {
    grid-column: auto;
  }

  .notification-recipient-entry {
    grid-template-columns: 1fr;
  }

  .notification-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}
