/* Antonello's message center stays beside the header, clear of the workbench. */
.notifications-trigger { position: relative; flex: 0 0 40px; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 12px; color: var(--text2); background: var(--surface); transition: color .18s, background .18s, border-color .18s; }
.notifications-trigger:hover, .notifications-trigger[aria-expanded="true"] { color: var(--text); background: var(--surface2); border-color: var(--text3); }
.notifications-trigger[aria-expanded="true"]::after { content: ''; position: absolute; bottom: -8px; left: 17px; width: 5px; height: 5px; border-radius: 50%; background: var(--red); }
.notifications-badge { position: absolute; top: -6px; right: -6px; min-width: 19px; height: 19px; display: flex; align-items: center; justify-content: center; padding: 0 4px; border: 2px solid var(--surface); border-radius: 10px; background: var(--red); color: #fff; font: 600 10px/1 var(--font); }
.notifications-badge[hidden] { display: none; }
#notifications-root { position: fixed; z-index: 45; top: var(--notifications-top, 80px); right: 24px; width: min(392px, calc(100% - 48px)); pointer-events: none; }
#notifications-root > * { pointer-events: auto; }
.notice-preview, .notifications-panel { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 18px 54px rgba(13, 22, 39, .18), 0 2px 8px rgba(13, 22, 39, .05); animation: notice-arrive .42s cubic-bezier(.2,.8,.2,1) both; overflow: hidden; }
[data-theme="dark"] .notice-preview, [data-theme="dark"] .notifications-panel { border-color: #314059; box-shadow: 0 20px 60px rgba(2,5,12,.55); }
.notice-preview { position: relative; border-top-color: var(--red-line); }
.notice-preview::before { content: ''; position: absolute; top: 18px; bottom: 18px; left: 0; width: 3px; border-radius: 0 3px 3px 0; background: var(--red); }
.notice-preview-open { display: flex; align-items: flex-start; gap: 12px; text-align: left; width: 100%; padding: 21px 18px 19px 20px; }
.notice-photo { flex: 0 0 44px; width: 44px; height: 44px; object-fit: cover; border-radius: 14px; background: var(--surface2); }
.notice-preview-copy, .notice-row-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.notice-preview-copy { padding-right: 13px; }
.notice-sender { display: flex; align-items: center; gap: 7px; color: var(--text2); font-size: 11px; line-height: 1.4; font-weight: 500; }
.notice-new { font-size: 9px; color: var(--red); border: 1px solid var(--red-line); padding: 2px 5px; border-radius: 4px; }
.notice-preview-copy > strong, .notice-row-copy > strong { color: var(--text); font-size: 14px; font-weight: 600; line-height: 1.35; }
.notice-snippet { color: var(--text2); font-size: 12px; line-height: 1.55; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.notice-preview-cta { display: inline-flex; align-items: center; gap: 7px; margin-top: 5px; font-size: 11px; color: var(--text); font-weight: 600; }
.notice-preview-cta svg { width: 13px; height: 13px; transition: transform .2s; }
.notice-preview-open:hover .notice-preview-cta svg { transform: translateX(3px); }
.notice-close, .notice-back { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 36px; height: 36px; width: 36px; border-radius: 10px; color: var(--text2); }
.notice-close:hover, .notice-back:hover { background: var(--surface2); color: var(--text); }
.notice-preview-close { position: absolute; right: 7px; top: 5px; width: 28px; height: 28px; }
.notice-preview-close svg { width: 13px; height: 13px; }
.notifications-panel { display: flex; flex-direction: column; max-height: calc(100dvh - var(--notifications-top, 80px) - 90px); }
.notice-header { display: flex; align-items: center; gap: 10px; padding: 19px 17px 17px 22px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.notice-header > div { flex: 1; min-width: 0; }
.notice-header h2 { font-size: 20px; letter-spacing: -.035em; }
.notice-header h2:focus { outline: none; }
.notice-header p { color: var(--text2); font-size: 11px; margin-top: 5px; }
.notice-header .notice-back { margin-left: -10px; }
.notice-list { overflow-y: auto; overscroll-behavior: contain; padding: 6px; }
.notice-row { width: 100%; display: flex; text-align: left; align-items: flex-start; gap: 12px; padding: 17px 14px; border-radius: 13px; }
.notice-row:hover { background: var(--surface2); }
.notice-row.is-unread { background: var(--red-soft); }
.notice-row.is-unread:hover { background: color-mix(in srgb, var(--red) 12%, var(--surface)); }
.notice-row > svg { width: 13px; height: 13px; flex-shrink: 0; align-self: center; color: var(--text3); }
.notice-unread-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--red); margin-left: auto; }
.notice-footer { padding: 13px 20px; text-align: center; border-top: 1px solid var(--line); font-size: 10px; color: var(--text2); flex-shrink: 0; }
.notice-thread { padding: 22px 20px 26px; overflow-y: auto; overscroll-behavior: contain; background: var(--bg); }
.notice-author { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; }
.notice-author .notice-photo { width: 36px; height: 36px; flex-basis: 36px; border-radius: 12px; }
.notice-author > span { display: flex; flex-direction: column; gap: 2px; }
.notice-author strong { font-size: 12px; font-weight: 600; }
.notice-author > span > span { font-size: 10px; color: var(--text2); }
.notice-bubble { background: var(--surface); padding: 20px; border: 1px solid var(--line); border-radius: 4px 17px 17px 17px; }
.notice-bubble h3 { font-size: 17px; line-height: 1.35; margin-bottom: 12px; }
.notice-bubble p { font-size: 14px; line-height: 1.75; white-space: pre-line; color: var(--text2); overflow-wrap: anywhere; }
.notice-action { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 19px; padding-top: 15px; border-top: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--text); }
.notice-action:hover { color: var(--red); }
.notice-action svg { flex-shrink: 0; }
.notifications-trigger:focus-visible, #notifications-root button:focus-visible, #notifications-root a:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
#notifications-root .notice-preview-open:focus-visible, #notifications-root .notice-row:focus-visible { outline-offset: -3px; }
@keyframes notice-arrive { from { opacity: 0; transform: translate(14px, -5px) scale(.97); } to { opacity: 1; transform: none; } }
@media (max-width: 768px) {
  .hdr > .notifications-trigger { margin-left: auto; }
  .hdr > .notifications-trigger ~ .avatar { margin-left: 0; }
  #notifications-root { right: 12px; width: min(392px, calc(100% - 24px)); }
  .notice-preview-close { width: 36px; height: 36px; right: 4px; top: 1px; }
  .notice-preview-copy { padding-right: 19px; }
  .notice-close, .notice-back { min-width: 40px; min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .notice-preview, .notifications-panel { animation: none; }
  .notifications-trigger, .notice-preview-cta svg { transition: none; }
}
