.notification-panel {
  overflow-x: hidden;
}

.notification-panel header {
  gap: 10px;
}

.notification-panel.is-settings {
  width: min(360px, calc(100vw - 24px));
  max-height: 68vh;
}

.notification-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: nowrap;
}

.notification-header-actions .notification-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: var(--text-2xs);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}

.notification-header-actions .notification-action-settings {
  background: #eef6ff;
  border-color: #c9def5;
  color: #075db8;
}

.notification-header-actions .notification-action-settings:hover {
  background: #e1efff;
  border-color: #afd0f0;
}

.notification-header-actions .notification-action-read {
  background: #eef8f2;
  border-color: #cbe7d5;
  color: #19734a;
}

.notification-header-actions .notification-action-read:hover:not(:disabled) {
  background: #e2f3e9;
  border-color: #b7dcc6;
}

.notification-header-actions .notification-action-button:disabled {
  background: #f3f5f7;
  border-color: #e1e6eb;
  color: #98a4b1;
  cursor: not-allowed;
  opacity: 1;
}

.notification-preferences {
  display: grid;
  gap: 10px;
  padding: 11px;
  background: #f7f9fc;
}

.notification-preference-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid #dce6ef;
  border-radius: 12px;
  background: #fff;
}

.notification-preference-main > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.notification-preference-main strong {
  color: #17324d;
  font-size: var(--text-xs);
  line-height: 1.25;
}

.notification-preference-main p {
  margin: 0;
  max-width: 245px;
  color: #65758b;
  font-size: var(--text-2xs);
  line-height: 1.35;
}

.notification-permission {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid #e2e8ef;
  border-radius: 10px;
  background: #fff;
  color: #607287;
  font-size: var(--text-2xs);
}

.notification-permission-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 7px;
  border-radius: 999px;
  background: #eef2f6;
  color: #52677c;
  font-size: var(--text-2xs);
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
}

.notification-permission.is-granted {
  border-color: #d5eadf;
  color: #39715a;
}

.notification-permission.is-granted .notification-permission-status {
  background: #e8f7ee;
  color: #18794e;
}

.notification-permission.is-denied {
  border-color: #f0d1cf;
  color: #a4443d;
}

.notification-permission.is-denied .notification-permission-status {
  background: #fff0ef;
  color: #b42318;
}

.notification-preference-section {
  display: grid;
  gap: 7px;
}

.notification-preference-heading {
  display: grid;
  gap: 2px;
  padding: 0 2px;
}

.notification-preference-heading strong {
  color: #17324d;
  font-size: var(--text-xs);
}

.notification-preference-heading small {
  color: #6b7c90;
  font-size: var(--text-2xs);
  line-height: 1.3;
}

.notification-preference-list {
  display: grid;
  border: 1px solid #dce6ef;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.notification-preference-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding: 8px 10px;
  border-bottom: 1px solid #edf2f6;
  cursor: pointer;
}

.notification-preference-row:last-child {
  border-bottom: 0;
}

.notification-preference-row:hover {
  background: #fbfdff;
}

.notification-preference-row > span:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.notification-preference-row strong {
  color: #17324d;
  font-size: var(--text-xs);
  line-height: 1.25;
}

.notification-preference-row small {
  color: #6b7c90;
  font-size: var(--text-2xs);
  line-height: 1.3;
}

.notification-switch {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.notification-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.notification-switch > span {
  position: relative;
  display: block;
  width: 34px;
  height: 20px;
  border: 1px solid #bdc9d5;
  border-radius: 999px;
  background: #cbd5e1;
  box-sizing: border-box;
  transition: background-color .16s ease, border-color .16s ease;
}

.notification-switch > span::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 44, 75, .28);
  transition: transform .16s ease;
}

.notification-switch input:checked + span {
  border-color: #075db8;
  background: #075db8;
}

.notification-switch input:checked + span::after {
  transform: translateX(14px);
}

.notification-switch input:focus-visible + span {
  outline: 3px solid rgba(7, 93, 184, .18);
  outline-offset: 2px;
}

.notification-switch input:disabled + span {
  opacity: .45;
  cursor: not-allowed;
}

.notification-switch-main > span {
  width: 40px;
  height: 22px;
}

.notification-switch-main > span::after {
  width: 16px;
  height: 16px;
}

.notification-switch-main input:checked + span::after {
  transform: translateX(18px);
}

.notification-preference-footer {
  display: grid;
  gap: 6px;
}

.notification-test-button {
  width: 100%;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid #bfd7ef;
  border-radius: 9px;
  background: #fff;
  color: #075db8;
  font-size: var(--text-2xs);
  font-weight: 700;
}

.notification-test-button:hover:not(:disabled) {
  background: #eef6ff;
}

.notification-test-button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.notification-preference-footer small {
  color: #718196;
  font-size: var(--text-2xs);
  line-height: 1.35;
}


.notification-list {
  background: #fff;
}

.notification-panel .notification-item {
  position: relative;
  width: 100%;
  display: grid;
  gap: 6px;
  padding: 13px 15px 12px 17px;
  border: 0;
  border-bottom: 1px solid #eaf0f5;
  border-radius: 0;
  background: #fff;
  color: #17324d;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background-color .16s ease, box-shadow .16s ease;
}

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

.notification-panel .notification-item:hover {
  background: #f7fbff;
}

.notification-panel .notification-item:focus-visible {
  z-index: 1;
  outline: 3px solid rgba(7, 93, 184, .18);
  outline-offset: -3px;
}

.notification-panel .notification-item.unread {
  background: #f3f8ff;
}

.notification-panel .notification-item.unread:hover {
  background: #edf6ff;
}

.notification-panel .notification-item.unread::before {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 5px;
  width: 3px;
  border-radius: 999px;
  background: #075db8;
}

.notification-item-title {
  display: block;
  margin: 0;
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: 1.32;
  letter-spacing: .002em;
}

.notification-title-prefix {
  color: #111827;
}

.notification-title-subject {
  color: #111827;
}

.notification-item-body {
  display: -webkit-box;
  overflow: hidden;
  color: #5f7288 !important;
  font-size: var(--text-xs) !important;
  font-weight: 500;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.notification-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding-top: 1px;
}

.notification-item-actor {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  color: #7b8794;
  font-size: var(--text-2xs);
  font-weight: 400;
  line-height: 1.25;
}

.notification-actor-label {
  flex: 0 0 auto;
  color: #7b8794;
}

.notification-actor-name {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 170px;
  overflow: hidden;
  padding: 2px 6px;
  border: 1px solid #d4e7f8;
  border-radius: 999px;
  background: #eef7ff;
  color: #60778f;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-item-actor.is-system {
  color: #8a96a3;
}

.notification-panel .notification-item time {
  flex: 0 0 auto;
  color: #8291a3;
  font-size: var(--text-2xs);
  font-weight: 600;
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .notification-action-button,
  .notification-switch > span,
  .notification-switch > span::after {
    transition: none;
  }
}

@media (max-width: 430px) {
  .notification-panel.is-settings {
    width: calc(100vw - 24px);
    max-height: 76vh;
  }

  .notification-panel header {
    align-items: flex-start;
    padding: 11px;
  }

  .notification-header-actions {
    gap: 5px;
  }

  .notification-header-actions .notification-action-button {
    min-height: 27px;
    padding: 5px 7px;
    font-size: var(--text-2xs);
  }

  .notification-preferences {
    padding: 9px;
  }

  .notification-preference-main,
  .notification-preference-row {
    gap: 8px;
  }
}
