.notification-trigger {
  position: relative; display: inline-flex; flex: 0 0 auto; align-items: center;
  justify-content: center; width: 34px; height: 34px; min-height: 34px;
  padding: 7px; border: 1px solid #e2dcd5; border-radius: 6px;
  background: #fffdfa; color: #817567; cursor: pointer;
}
.notification-trigger:hover,
.notification-trigger[aria-expanded="true"] { border-color: #b89575; background: #f4eee7; color: #8e6543; }
.notification-trigger:focus-visible,
.notification-panel button:focus-visible { outline: 2px solid #9c7857; outline-offset: 2px; }
.notification-trigger .notification-icon { width: 18px; height: 18px; flex: 0 0 18px; }
.notification-count {
  position: absolute; top: -5px; right: -6px; display: grid; place-items: center;
  min-width: 17px; height: 17px; padding: 0 4px; border: 2px solid #faf9f7;
  border-radius: 10px; background: #b87954; color: #fff; font-size: 9px;
  font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums;
}
.notification-count[hidden] { display: none; }
.notification-panel {
  position: fixed; inset: 0; z-index: 110; display: flex; flex-direction: column;
  box-sizing: border-box; width: 560px; height: fit-content; max-width: calc(100vw - 32px); max-height: 74dvh; margin: auto;
  padding: 0; overflow: hidden; border: 1px solid #ded5ca; border-radius: 12px;
  background: #fff; color: #25313f; font-family: inherit; font-size: 12px;
  line-height: 1.5; box-shadow: 0 18px 56px #3b2c1b30; text-align: left;
}
.notification-panel:not([open]) { display: none; }
.notification-panel::backdrop { background: #30282038; pointer-events: auto; }
.notification-panel *, .notification-panel *::before, .notification-panel *::after { box-sizing: border-box; }
.notification-panel .notification-icon { display: inline-block; flex: 0 0 auto; width: 15px; height: 15px; vertical-align: middle; }
.notification-panel button { font-family: inherit; }
.notification-panel-head { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; }
.notification-panel-head > div { display: flex; align-items: baseline; gap: 9px; min-width: 0; }
.notification-panel-head h2 { margin: 0; font-size: 18px; line-height: 24px; font-weight: 750; }
.notification-total { color: #9a8170; font-size: 12px; font-variant-numeric: tabular-nums; }
.notification-close { display: grid; flex: 0 0 26px; place-items: center; width: 26px; height: 26px; padding: 4px; border: 0; border-radius: 4px; background: transparent; color: #8e8a85; cursor: pointer; }
.notification-close:hover { background: #f3efea; }
.notification-tools { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 8px; min-height: 42px; padding: 0 20px; border-bottom: 1px solid #ede8e1; }
.notification-tabs { display: flex; align-self: stretch; gap: 16px; min-width: 0; }
.notification-tab { min-height: 38px; margin: 0; padding: 7px 0 8px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #92908a; font-size: 12px; white-space: nowrap; cursor: pointer; }
.notification-tab[aria-selected="true"] { border-bottom-color: #a67853; color: #8b603e; font-weight: 700; }
.notification-panel .notification-text-button { display: inline-flex; align-items: center; justify-content: center; gap: 3px; min-height: 27px; padding: 3px 0; border: 0; border-radius: 3px; background: transparent; color: #8f7057; font-size: 11px; line-height: 18px; cursor: pointer; white-space: nowrap; }
.notification-panel .notification-text-button:hover { color: #67482f; text-decoration: underline; text-underline-offset: 3px; }
.notification-panel button:disabled { opacity: .45; cursor: default; }
.notification-panel .notification-text-button:disabled:hover { text-decoration: none; }
.notification-new { display: block; flex: 0 0 auto; width: 100%; min-height: 32px; padding: 7px 12px; border: 0; border-bottom: 1px solid #e8dfd3; background: #f8f2e9; color: #926b47; font-size: 11px; cursor: pointer; }
.notification-list { flex: 1 1 auto; min-height: 0; max-height: none; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #c6b9ac transparent; }
.notification-list::-webkit-scrollbar { width: 4px; }
.notification-list::-webkit-scrollbar-thumb { border-radius: 4px; background: #c6b9ac; }
.notification-item { position: relative; min-width: 0; margin: 0; padding: 14px 20px 10px; border-bottom: 1px solid #f0ece6; background: #fff; }
.notification-item.is-unread { background: #fcf9f4; }
.notification-row-kind { display: flex; align-items: center; gap: 6px; min-width: 0; margin-bottom: 5px; }
.notification-kind { display: inline-flex; align-items: center; gap: 5px; color: #807163; font-size: 10px; font-weight: 650; white-space: nowrap; }
.notification-kind.is-help { color: #b27836; }
.notification-row-kind time { margin-left: auto; color: #9a9b9d; font-size: 10px; white-space: nowrap; }
.notification-unread-dot { flex: 0 0 5px; width: 5px; height: 5px; border-radius: 50%; background: #ac7a53; }
.notification-resolved { padding: 1px 5px; border-radius: 4px; background: #f0f2ef; color: #7a8c7d; font-size: 9px; white-space: nowrap; }
.notification-open { display: block; width: 100%; min-width: 0; margin: 0; padding: 0; border: 0; background: transparent; color: #26313d; text-align: left; cursor: pointer; }
.notification-open strong { display: block; overflow: hidden; color: inherit; font-size: 13px; line-height: 20px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.notification-open:hover strong { color: #8b603e; }
.notification-body { display: -webkit-box; overflow: hidden; margin-top: 4px; color: #8c8b88; font-size: 12px; line-height: 19px; overflow-wrap: anywhere; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.notification-body b { color: #726e68; font-weight: 500; }
.notification-row-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; margin-top: 5px; }
.notification-help-button { display: inline-flex; align-items: center; justify-content: center; min-height: 26px; padding: 3px 9px; border: 1px solid #d8bea2; border-radius: 4px; background: #fff; color: #976b43; font-size: 10px; line-height: 18px; cursor: pointer; }
.notification-help-button:hover { border-color: #b98d65; background: #fbf5ed; }
.notification-read-label, .notification-inline-status { margin-left: auto; color: #a4a19c; font-size: 10px; }
.notification-state { display: flex; min-height: 170px; flex-direction: column; align-items: center; justify-content: center; gap: 9px; padding: 27px 16px; color: #8a8c90; font-size: 11px; text-align: center; }
.notification-empty > .notification-icon { width: 25px; height: 25px; margin-bottom: 3px; color: #c2b4a5; }
.notification-empty strong { color: #666762; font-size: 12px; font-weight: 600; }
.notification-empty > span { color: #a1a19d; line-height: 19px; }
.notification-spinner { width: 17px; height: 17px; border: 2px solid #e8dfd5; border-top-color: #9c7657; border-radius: 50%; animation: notification-spin .7s linear infinite; }
.notification-error { display: flex; flex: 0 0 auto; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; padding: 8px 16px; border-bottom: 1px solid #f0e4d8; background: #fff9f4; color: #a7744f; font-size: 11px; overflow-wrap: anywhere; }
.notification-row-error { margin: 5px 0 0; padding: 6px 8px; border-radius: 4px; background: #fcefe9; color: #a2644b; font-size: 10px; line-height: 17px; overflow-wrap: anywhere; }
.notification-more { display: block; width: calc(100% - 32px); min-height: 32px; margin: 10px 16px; padding: 6px 12px; border: 1px solid #e7dfd5; border-radius: 5px; background: #fff; color: #8f7964; font-size: 11px; cursor: pointer; }
.notification-more:hover { background: #faf6ef; }
.notification-panel-footer { flex: 0 0 auto; margin: 0; padding: 10px 20px; border-top: 1px solid #eee8e0; background: #fcfbf8; color: #a2988d; font-size: 11px; line-height: 17px; }
@keyframes notification-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .notification-spinner { animation: none; } }
@media (max-width: 550px) {
  .notification-trigger { width: 32px; height: 32px; min-height: 32px; padding: 6px; }
  .notification-panel { width: calc(100vw - 24px); max-width: calc(100vw - 24px); max-height: 84dvh; border-radius: 10px; }
  .notification-panel-head { padding: 15px 14px 10px; }
  .notification-tools { padding-left: 14px; padding-right: 14px; }
  .notification-item { padding-left: 14px; padding-right: 14px; }
  .notification-panel-footer { padding-left: 14px; padding-right: 14px; font-size: 10px; line-height: 16px; }
  .notification-list { max-height: none; }
}

/* A short reminder every twelve seconds; the button and badge stay still. */
.notification-trigger.has-unread[aria-expanded="false"] > .notification-icon {
  transform-origin: 50% 15%; animation: notification-reminder 12s ease-in-out infinite;
}
@keyframes notification-reminder {
  0%, 7%, 100% { transform: rotate(0); }
  1% { transform: rotate(15deg); }
  2% { transform: rotate(-13deg); }
  3% { transform: rotate(10deg); }
  4% { transform: rotate(-8deg); }
  5% { transform: rotate(5deg); }
  6% { transform: rotate(-3deg); }
}
@media (prefers-reduced-motion: reduce) {
  .notification-trigger.has-unread[aria-expanded="false"] > .notification-icon { animation: none; }
}
