.mybuddha-notifications {
  position: fixed;
  z-index: 99990;
  top: max(14px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  color: #2d2924;
  font-family: inherit;
}

body.admin-bar .mybuddha-notifications {
  top: 46px;
}

.mybuddha-notifications__trigger {
  position: relative;
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(139, 111, 71, 0.22);
  border-radius: 50%;
  background: rgba(255, 253, 249, 0.96);
  box-shadow: 0 6px 20px rgba(58, 42, 24, 0.13);
  color: #6d5035;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.mybuddha-notifications__trigger:hover,
.mybuddha-notifications__trigger:focus-visible,
.mybuddha-notifications__trigger[aria-expanded="true"] {
  outline: none;
  background: #fff;
  box-shadow: 0 8px 24px rgba(58, 42, 24, 0.2);
  transform: translateY(-1px);
}

.mybuddha-notifications__trigger svg {
  display: block;
  width: 24px;
  height: 24px;
  fill: transparent;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.mybuddha-notifications__badge {
  position: absolute;
  top: -4px;
  right: -5px;
  display: inline-flex;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  align-items: center;
  justify-content: center;
  border: 2px solid #fffdf9;
  border-radius: 999px;
  background: #b64141;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.mybuddha-notifications__badge.is-hidden {
  display: none;
}

.mybuddha-notifications__panel {
  position: absolute;
  top: 52px;
  right: 0;
  width: min(390px, calc(100vw - 28px));
  max-height: min(620px, calc(100vh - 86px));
  overflow: hidden;
  border: 1px solid #e7ded2;
  border-radius: 20px;
  background: #fffdf9;
  box-shadow: 0 18px 48px rgba(43, 31, 19, 0.2);
}

.mybuddha-notifications__panel[hidden] {
  display: none;
}

.mybuddha-notifications__header {
  display: flex;
  min-height: 58px;
  padding: 0 14px 0 20px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #eee6db;
}

.mybuddha-notifications__header h2 {
  margin: 0;
  padding: 0;
  color: #2d2924;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
}

.mybuddha-notifications__close {
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #756a5e;
  font-size: 27px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
}

.mybuddha-notifications__close:hover,
.mybuddha-notifications__close:focus-visible {
  outline: none;
  background: #f3ede5;
}

.mybuddha-notifications__list {
  max-height: min(560px, calc(100vh - 144px));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.mybuddha-notifications__item {
  position: relative;
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 12px;
  min-height: 76px;
  padding: 14px 18px;
  align-items: center;
  border-bottom: 1px solid #f0e9df;
  color: inherit;
  text-decoration: none;
}

.mybuddha-notifications__item:hover,
.mybuddha-notifications__item:focus-visible {
  outline: none;
  background: #f8f2e9;
  color: inherit;
  text-decoration: none;
}

.mybuddha-notifications__item.is-unread {
  background: #f7efe4;
}

.mybuddha-notifications__item.is-unread::after {
  position: absolute;
  top: 50%;
  right: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a57444;
  content: "";
  transform: translateY(-50%);
}

.mybuddha-notifications__avatar {
  display: grid;
  width: 44px;
  height: 44px;
  overflow: hidden;
  place-items: center;
  border-radius: 50%;
  background: #e9dfd2;
  color: #6b543d;
  font-size: 15px;
  font-weight: 700;
}

.mybuddha-notifications__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mybuddha-notifications__message {
  display: block;
  padding-right: 7px;
  color: #352f29;
  font-size: 13px;
  line-height: 1.55;
}

.mybuddha-notifications__time {
  display: block;
  margin-top: 3px;
  color: #8a8075;
  font-size: 11px;
  line-height: 1.3;
}

.mybuddha-notifications__state {
  margin: 0;
  padding: 34px 20px;
  color: #7b7369;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.entry-content > div:has(> a[href*="lang=en"]):has(> a[href*="lang=ja"]) {
  position: static !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  transform: none !important;
}

@media (min-width: 783px) {
  body.admin-bar .mybuddha-notifications {
    top: 38px;
  }
}

@media (max-width: 480px) {
  .entry-content > div:has(> a[href*="lang=en"]):has(> a[href*="lang=ja"]) {
    margin: 8px 14px 0 !important;
    text-align: left !important;
  }

  .mybuddha-notifications {
    right: max(12px, env(safe-area-inset-right));
  }

  .mybuddha-notifications__panel {
    position: fixed;
    top: max(68px, calc(env(safe-area-inset-top) + 58px));
    right: 10px;
    left: 10px;
    width: auto;
    max-height: calc(100vh - max(82px, calc(env(safe-area-inset-top) + 72px)));
  }

  .mybuddha-notifications__list {
    max-height: calc(100vh - max(140px, calc(env(safe-area-inset-top) + 130px)));
  }
}

@media (prefers-reduced-motion: reduce) {
  .mybuddha-notifications__trigger {
    transition: none;
  }
}
