.user-notes-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  padding: 24px;
  box-sizing: border-box;
}

.user-notes-overlay[hidden] {
  display: none !important;
}

.user-notes-panel {
  position: relative;
  width: min(520px, 100%);
  max-height: min(70vh, 640px);
  background: #fffef8;
  border: 1px solid #d8d4c8;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-notes-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #555;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.user-notes-close:hover {
  background: rgba(0, 0, 0, 0.06);
}

.user-notes-title {
  margin: 0;
  padding: 14px 44px 8px 16px;
  font-size: 15px;
  font-weight: 600;
  color: #2a2f4d;
  border-bottom: 1px solid #ece8dc;
}

.user-notes-editor {
  flex: 1 1 auto;
  min-height: 200px;
  margin: 0;
  padding: 14px 16px 16px;
  border: none;
  resize: none;
  outline: none;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  line-height: 1.55;
  color: #222;
  background: transparent;
  box-sizing: border-box;
}

.user-notes-status {
  padding: 0 16px 10px;
  font-size: 12px;
  color: #888;
  min-height: 18px;
}

.user-notes-context-menu {
  position: fixed;
  z-index: 12001;
  min-width: 180px;
  padding: 4px 0;
  background: #fff;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
}

.user-notes-context-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 8px 12px;
  border: none;
  background: transparent;
  font-size: 14px;
  color: #222;
  text-align: left;
  cursor: pointer;
}

.user-notes-context-item:hover:not(:disabled) {
  background: #eef4ff;
}

.user-notes-context-item img {
  flex-shrink: 0;
  opacity: 0.85;
}

body:not(.logged-in) .user-notes-context-item.auth-required {
  opacity: 0.55;
  cursor: not-allowed;
}

.doc-author-link,
.username,
.user-notes-target {
  cursor: context-menu;
}
