/* Shared header notification controls and popover geometry. */
.hn-group {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 4px;
  margin-right: 14px;
}
.hn-trigger {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md, 8px);
  background: transparent;
  color: #4e5969;
  cursor: pointer;
  transition:
    color 0.2s,
    background 0.2s;
}
.hn-trigger:hover,
.hn-trigger[aria-expanded="true"] {
  color: var(--text-main, #1f2329);
  background: rgba(0, 0, 0, 0.04);
}
.hn-trigger svg {
  display: block;
  width: 24px;
  height: 24px;
  stroke-width: 1.8;
}
.hn-trigger .hn-unread-dot {
  position: absolute;
  right: 5px;
  top: 4px;
  width: 10px;
  height: 10px;
  min-width: 0;
  padding: 0;
  border: 2px solid var(--bg-body, #fafafa);
  border-radius: 50%;
  background: var(--primary-color, #ff2442);
  font-size: 0;
  line-height: 0;
}
.hn-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  width: 360px;
  max-width: calc(100vw - 24px);
  max-height: min(64dvh, 480px);
  overflow: hidden;
  z-index: 1200;
  border: 1px solid var(--border-color, #e4e6eb);
  border-radius: var(--radius-lg, 12px);
  background: var(--bg-white, #ffffff);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  color: var(--text-main, #1f2329);
  text-align: left;
}
.hn-popover[hidden],
.hn-unread-dot[hidden] {
  display: none;
}
.hn-popover-head,
.hn-popover-foot {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 12px;
  margin: 0;
  background: var(--bg-white, #ffffff);
}
.hn-popover-head {
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-color, #e4e6eb);
}
.hn-popover-head h2 {
  margin: 0;
  font-size: 14px;
  line-height: 24px;
  font-weight: 600;
}
.hn-popover-head :is(button, a) {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--primary-hover, #d91030);
  text-decoration: none;
  font-family: inherit;
  font-size: 12px;
  line-height: 20px;
  font-weight: 400;
  cursor: pointer;
}
.hn-popover-head :is(button, a):hover {
  color: var(--primary-hover, #d91030);
  text-decoration: underline;
}
.hn-popover-head button:disabled {
  opacity: 0.6;
  cursor: default;
}
.hn-popover-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
}
.hn-popover-foot {
  justify-content: center;
  width: 100%;
  padding: 10px 16px;
  border: 0;
  border-top: 1px solid var(--border-color, #e4e6eb);
  color: var(--text-sub, #646a73);
  font: inherit;
  font-size: 12px;
  line-height: 20px;
  text-decoration: none;
  cursor: pointer;
}
.hn-popover-foot:hover {
  color: var(--primary-hover, #d91030);
  background: var(--bg-body, #fafafa);
}
.hn-new-badge {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--primary-hover, #d91030);
  color: var(--bg-white, #ffffff);
  font-size: 9px;
  font-weight: 700;
  line-height: 16px;
  letter-spacing: 0.2px;
}
.hn-popover :is(.cl-card p, .mn-message p) {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hn-trigger:focus-visible,
.hn-popover :is(button, a):focus-visible {
  outline: 2px solid var(--primary-color, #ff2442);
  outline-offset: 3px;
}
@media (max-width: 960px) {
  .hn-group {
    margin-right: 0;
  }
}
@media (max-width: 640px) {
  .hn-popover {
    position: fixed;
    top: 64px;
    left: 50%;
    width: min(360px, calc(100vw - 24px));
    max-height: min(64dvh, 480px, calc(100dvh - 80px));
  }
}
@media (prefers-reduced-motion: reduce) {
  .hn-trigger {
    transition: none;
  }
}
