/* Universal Content Notes — pins, region boxes, popover composer, slide-over
   drawer, @mention autocomplete, and Finder grid open-note badges. */

.cn-overlay {
  position: absolute;
  z-index: 25;
  pointer-events: none;
  box-sizing: border-box;
}
.cn-overlay.is-markup {
  pointer-events: auto;
  cursor: crosshair;
  outline: 2px dashed rgba(255, 196, 61, 0.85);
  outline-offset: -2px;
}

.cn-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--accent, #e05a2b);
  color: #fff;
  font: 700 12px/1 var(--font, system-ui);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.cn-pin:hover,
.cn-pin.is-focused {
  transform: translate(-50%, -50%) scale(1.18);
  box-shadow: 0 0 0 4px rgba(255, 196, 61, 0.55), 0 4px 12px rgba(0, 0, 0, 0.5);
  z-index: 4;
}

.cn-rect {
  position: absolute;
  border: 2px solid #ffc43d;
  background: rgba(255, 196, 61, 0.12);
  border-radius: 4px;
  padding: 0;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45);
}
.cn-rect.is-focused,
.cn-rect:hover {
  background: rgba(255, 196, 61, 0.22);
  border-color: #fff;
}
.cn-rect-badge {
  position: absolute;
  top: -11px;
  left: -11px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent, #e05a2b);
  color: #fff;
  border: 2px solid #fff;
  font: 700 11px/18px var(--font, system-ui);
  text-align: center;
}

.cn-drag-rect {
  position: absolute;
  border: 2px dashed #ffc43d;
  background: rgba(255, 196, 61, 0.16);
  pointer-events: none;
}

.cn-popover {
  position: absolute;
  z-index: 35;
  width: 270px;
  background: var(--panel, #1e1f24);
  color: var(--ink, #f4f4f6);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.14));
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cn-pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.cn-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(360px, 92vw);
  z-index: 40;
  background: var(--panel, #1b1c20);
  color: var(--ink, #f4f4f6);
  border-left: 1px solid var(--line, rgba(255, 255, 255, 0.12));
  box-shadow: -8px 0 28px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
}
.cn-drawer[hidden] { display: none; }

.cn-drawer-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line, rgba(255, 255, 255, 0.1));
}
.cn-drawer-title {
  font-size: 13px;
  margin-right: 4px;
}
.cn-drawer-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cn-tabs {
  display: inline-flex;
  gap: 2px;
  background: rgba(127, 127, 127, 0.14);
  padding: 2px;
  border-radius: 6px;
}
.cn-tab {
  border: 0;
  background: transparent;
  color: inherit;
  opacity: 0.72;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
}
.cn-tab.is-on {
  opacity: 1;
  background: var(--bg, rgba(255, 255, 255, 0.12));
}

.cn-markup-btn {
  border: 1px solid var(--line, rgba(255, 255, 255, 0.18));
  background: transparent;
  color: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.cn-markup-btn.is-on {
  background: #ffc43d;
  color: #111;
  border-color: #ffc43d;
}

.cn-close {
  border: 0;
  background: transparent;
  color: inherit;
  opacity: 0.7;
  font-size: 18px;
  line-height: 1;
  padding: 2px 6px;
  cursor: pointer;
}
.cn-close:hover { opacity: 1; }

.cn-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cn-empty {
  padding: 28px 12px;
  text-align: center;
  font-size: 12px;
  opacity: 0.65;
}

.cn-card {
  border: 1px solid var(--line, rgba(255, 255, 255, 0.1));
  background: rgba(127, 127, 127, 0.08);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cn-card.is-focused {
  border-color: #ffc43d;
  box-shadow: 0 0 0 2px rgba(255, 196, 61, 0.25);
}
.cn-card.is-resolved {
  opacity: 0.72;
}

.cn-card-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.cn-card-pin {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 0;
  background: var(--accent, #e05a2b);
  color: #fff;
  font: 700 11px/20px var(--font, system-ui);
  cursor: pointer;
  flex: 0 0 auto;
}
.cn-time-pill {
  border: 0;
  background: rgba(255, 196, 61, 0.2);
  color: #ffc43d;
  font: 600 11px/1.2 ui-monospace, monospace;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
}
.cn-author { font-size: 12px; }
.cn-when { font-size: 11px; opacity: 0.6; }
.cn-card-acts {
  margin-left: auto;
  display: inline-flex;
  gap: 4px;
}
.cn-act {
  border: 1px solid var(--line, rgba(255, 255, 255, 0.14));
  background: transparent;
  color: inherit;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 5px;
  cursor: pointer;
}
.cn-act:hover { background: rgba(127, 127, 127, 0.18); }
.cn-act.danger:hover { color: #ff6b6b; border-color: #ff6b6b; }

.cn-anchor-lbl {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
  font: italic 11px/1.3 var(--font, system-ui);
  opacity: 0.72;
  cursor: pointer;
}
.cn-anchor-lbl:hover { opacity: 1; text-decoration: underline; }

.cn-anchor-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255, 196, 61, 0.14);
  border: 1px solid rgba(255, 196, 61, 0.35);
  font-size: 11px;
}
.cn-anchor-chip[hidden] { display: none; }
.cn-anchor-chip-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cn-body {
  font-size: 13px;
  line-height: 1.42;
  white-space: pre-wrap;
  word-break: break-word;
}
.cn-mention {
  color: #ffc43d;
  font-weight: 600;
}
.cn-mentions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.cn-work-pill {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 99px;
  background: rgba(99, 179, 237, 0.16);
  color: #7cc4fa;
}

.cn-replies {
  border-top: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  padding-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cn-reply {
  padding-left: 8px;
  border-left: 2px solid var(--line, rgba(255, 255, 255, 0.15));
  font-size: 12px;
}
.cn-reply-head {
  display: flex;
  gap: 6px;
  align-items: baseline;
  margin-bottom: 2px;
}
.cn-reply-body {
  white-space: pre-wrap;
  word-break: break-word;
}

.cn-reply-form {
  position: relative;
  display: flex;
  gap: 6px;
  margin-top: 2px;
}
.cn-reply-input {
  flex: 1;
  min-width: 0;
  background: rgba(0, 0, 0, 0.22);
  color: inherit;
  border: 1px solid var(--line, rgba(255, 255, 255, 0.14));
  border-radius: 6px;
  padding: 5px 8px;
  font: inherit;
  font-size: 12px;
}
.cn-reply-send {
  border: 0;
  background: rgba(127, 127, 127, 0.22);
  color: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 0 10px;
  border-radius: 6px;
  cursor: pointer;
}

.cn-composer {
  position: relative;
  padding: 10px 12px;
  border-top: 1px solid var(--line, rgba(255, 255, 255, 0.1));
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cn-input {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  background: rgba(0, 0, 0, 0.22);
  color: inherit;
  border: 1px solid var(--line, rgba(255, 255, 255, 0.16));
  border-radius: 6px;
  padding: 7px 9px;
  font: inherit;
  font-size: 13px;
}
.cn-composer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.cn-hint {
  font-size: 11px;
  opacity: 0.6;
}
.cn-send {
  border: 0;
  background: var(--accent, #e05a2b);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
}
.cn-send:disabled { opacity: 0.5; cursor: default; }

.cn-mention-menu {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: calc(100% + 4px);
  z-index: 60;
  background: var(--panel, #22242a);
  color: var(--ink, #f4f4f6);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.18));
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.cn-mention-opt {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 7px 10px;
  font: inherit;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  text-align: left;
}
.cn-mention-opt.is-active,
.cn-mention-opt:hover {
  background: rgba(255, 196, 61, 0.18);
}
.cn-mention-role {
  font-size: 10px;
  opacity: 0.6;
}

/* Lightbox Notes button & badge */
.lb-notes-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.lb-notes-btn.has-notes {
  border-color: rgba(255, 196, 61, 0.65);
}
.lb-notes-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--accent, #e05a2b);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

/* Finder grid card open-note badge */
.card-note-badge {
  position: absolute;
  top: 7px;
  left: 7px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 99px;
  background: rgba(20, 20, 24, 0.82);
  color: #ffc43d;
  font: 700 11px/1.2 var(--font, system-ui);
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* Work Board card direct note jump chip */
.workcard-note-link {
  border: 1px solid var(--line, rgba(255, 255, 255, 0.16));
  background: rgba(255, 196, 61, 0.14);
  color: inherit;
  font: 600 11px/1.2 var(--font, system-ui);
  padding: 2px 7px;
  border-radius: 99px;
  cursor: pointer;
}
.workcard-note-link:hover {
  background: rgba(255, 196, 61, 0.28);
}
