
/* ════════════════════════════════════════════════════════════════
   DoxMAP — Collaboration UI Styles
   Covers: Share Dialog, Live Cursors, Node Lock, Comment Panel,
           Avatar Bar, Version Panel, Comment Badges
   ════════════════════════════════════════════════════════════════ */

/* ── Share Dialog ── */
.share-dialog-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10000;
}

.share-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90vw;
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
  z-index: 10001;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.share-dialog h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.share-link-row {
  display: flex;
  gap: 8px;
}

.share-link-input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-2);
  font-family: monospace;
}

.share-copy-btn, .share-invite-btn {
  background: var(--brand);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}

.share-copy-btn:hover, .share-invite-btn:hover { opacity: 0.9; }

.share-access-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface2);
  border-radius: 16px;
  font-size: 13px;
}

.share-access-row label { font-weight: 600; color: var(--text-2); }

.share-access-select {
  background: transparent;
  border: none;
  color: var(--brand);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  outline: none;
}

.share-invite-row {
  display: flex;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.share-invite-input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text);
}

.share-collab-list {
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.share-collab-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--surface2);
  border-radius: 12px;
  font-size: 13px;
}

.share-collab-item span:first-child {
  flex: 1;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.share-collab-role {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(124, 111, 255, 0.15);
  color: var(--brand);
}

.share-close-btn {
  margin-top: 8px;
  padding: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.share-close-btn:hover { background: var(--hover-bg); }
.share-invite-btn:disabled { opacity: 0.5; cursor: not-allowed; }


/* ════════════════════════════════════════════
   FEATURE 1 — LIVE CURSOR PRESENCE
   ════════════════════════════════════════════ */

/* Cursor element lives inside canvas-world so it pans/zooms automatically */
.collab-cursor {
  position: absolute;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 900;
  /* Smooth glide between Firestore position updates (~100ms cadence) */
  transition: transform 120ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform-origin: 0 0;
  will-change: transform;
}

.collab-cursor svg {
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

.collab-cursor-label {
  position: absolute;
  top: 18px;
  left: 12px;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  /* Appear with a quick pop */
  animation: cursor-label-pop 0.2s ease-out;
}

@keyframes cursor-label-pop {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}


/* ════════════════════════════════════════════
   COLLABORATION MODE BANNER  
   ════════════════════════════════════════════ */

.collab-mode-banner {
  position: fixed;
  top: 52px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30, 30, 40, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(124, 111, 255, 0.3);
  border-radius: 20px;
  padding: 6px 14px 6px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  z-index: 800;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: banner-slide-down 0.3s ease-out;
}

@keyframes banner-slide-down {
  from { transform: translateX(-50%) translateY(-12px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0);    opacity: 1; }
}

.collab-mode-banner .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #34C759;
  box-shadow: 0 0 6px rgba(52, 199, 89, 0.7);
  animation: dot-pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes dot-pulse {
  0%, 100% { box-shadow: 0 0 4px rgba(52, 199, 89, 0.5); }
  50%       { box-shadow: 0 0 10px rgba(52, 199, 89, 0.9); }
}

/* Avatar strip inside the banner */
.collab-avatars {
  display: flex;
  align-items: center;
  gap: -6px; /* overlap */
}

/* Action buttons inside the collab banner (Leave / Stop Sharing) */
.collab-banner-btn {
  background: none;
  border: 1px solid var(--brand);
  color: var(--brand);
  border-radius: 12px;
  padding: 3px 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  margin-left: 8px;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
.collab-banner-btn:hover {
  background: var(--brand);
  color: #fff;
}
.collab-banner-btn:active { transform: scale(0.96); }

.collab-banner-btn-danger {
  border-color: #ff453a;
  color: #ff6b61;
}
.collab-banner-btn-danger:hover {
  background: #ff453a;
  color: #fff;
}

.collab-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(30, 30, 40, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  margin-left: -6px;
  cursor: default;
  transition: transform 0.2s ease, z-index 0s;
  position: relative;
  z-index: 1;
}

.collab-avatar:first-child { margin-left: 4px; }

.collab-avatar:hover {
  transform: scale(1.25) translateY(-2px);
  z-index: 10;
}

/* Tooltip on avatar hover */
.collab-avatar::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.85);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}

.collab-avatar:hover::after { opacity: 1; }


/* ── Online Status Dot ── */
.collab-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.collab-status-dot.online {
  background: #34C759;
  box-shadow: 0 0 4px rgba(52, 199, 89, 0.5);
}

.collab-status-dot.offline { background: rgba(255, 255, 255, 0.2); }


/* ════════════════════════════════════════════
   FEATURE 2 — NODE LOCKING
   ════════════════════════════════════════════ */

/* Edit lock badge — shown above nodes currently being edited by a collaborator */
.collab-edit-badge {
  position: absolute;
  top: -26px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  pointer-events: none;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  animation: edit-badge-pulse 1.5s ease-in-out infinite;
}

@keyframes edit-badge-pulse {
  0%, 100% { opacity: 0.9; transform: translateX(-50%) scale(1); }
  50%       { opacity: 1;   transform: translateX(-50%) scale(1.04); }
}

/* Lock overlay: tinted dashed border on the node */
.collab-node-locked {
  outline: 2.5px dashed currentColor !important;
  outline-offset: 3px;
  opacity: 0.75;
  cursor: not-allowed !important;
  pointer-events: none;
  transition: outline 0.2s, opacity 0.2s;
}


/* ════════════════════════════════════════════
   FEATURE 3 — COMMENT PANEL
   ════════════════════════════════════════════ */

.comment-panel {
  position: fixed;
  top: 0; right: 0;
  width: 320px;
  height: 100dvh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 40px rgba(0,0,0,0.4);
  z-index: 5000;
  display: flex;
  flex-direction: column;
  transform: translateX(110%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.comment-panel.open { transform: translateX(0); }

.comment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.comment-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.comment-close-btn {
  background: var(--surface2);
  border: none;
  color: var(--text-2);
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}

.comment-close-btn:hover { background: var(--hover-bg); }

/* Scrollable comment list */
.comment-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Individual comment bubble */
.comment-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  position: relative;
  animation: comment-pop 0.2s ease-out;
}

@keyframes comment-pop {
  from { transform: scale(0.95) translateY(6px); opacity: 0; }
  to   { transform: scale(1)    translateY(0);   opacity: 1; }
}

.comment-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.comment-item-avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.comment-item-author {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
}

.comment-item-time {
  font-size: 10px;
  color: var(--text-3);
  margin-left: auto;
}

.comment-item-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
}

/* @mention highlight inside comment text */
.comment-item-text .mention {
  color: var(--brand);
  font-weight: 600;
}

.comment-item-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.comment-item-actions button {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.comment-item-actions button:hover {
  background: var(--hover-bg);
  color: var(--text);
}

/* Comment input row at bottom of panel */
.comment-input-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  position: relative;
}

.comment-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text);
  font-family: inherit;
  resize: none;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.comment-input:focus { border-color: var(--brand); }

.comment-send-btn {
  align-self: flex-end;
  background: var(--brand);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

.comment-send-btn:hover { opacity: 0.9; }
.comment-send-btn:active { transform: scale(0.97); }

/* @mention autocomplete dropdown */
.mention-dropdown {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 12px; right: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  overflow: hidden;
  z-index: 100;
  animation: mention-drop-pop 0.15s ease-out;
}

@keyframes mention-drop-pop {
  from { transform: translateY(6px); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}

.mention-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s;
}

.mention-item:hover { background: var(--hover-bg); }

.mention-item-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
}

.mention-item-name {
  font-weight: 600;
  flex: 1;
}


/* ── Comment badge on nodes ── */
.comment-badge {
  position: absolute;
  top: -10px;
  right: -10px;
  min-width: 18px;
  height: 18px;
  background: var(--brand);
  color: #fff;
  border-radius: 9px;
  font-size: 9px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  pointer-events: auto;
  cursor: pointer;
  z-index: 15;
  box-shadow: 0 2px 8px rgba(124, 111, 255, 0.5);
  animation: badge-pop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: transform 0.2s;
}

.comment-badge:hover { transform: scale(1.2); }

@keyframes badge-pop {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

/* New comment flash — briefly highlights badge when a new comment arrives */
.comment-badge.new-comment {
  animation: badge-new-flash 0.6s ease-out;
}

@keyframes badge-new-flash {
  0%   { background: #FF6B6B; transform: scale(1.4); }
  60%  { background: #FF6B6B; transform: scale(1.1); }
  100% { background: var(--brand); transform: scale(1); }
}


/* ════════════════════════════════════════════
   VERSION HISTORY PANEL  
   ════════════════════════════════════════════ */

.version-panel {
  position: fixed;
  top: 0; right: 0;
  width: 300px;
  height: 100dvh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 40px rgba(0,0,0,0.4);
  z-index: 4900;
  display: flex;
  flex-direction: column;
  transform: translateX(110%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.version-panel.open { transform: translateX(0); }

.version-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px 16px 12px;
  border-bottom: 1px solid var(--border);
}

.version-header h3 { margin: 0; font-size: 16px; font-weight: 700; flex: 1; }

.version-save-btn, .version-close-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.version-save-btn:hover, .version-close-btn:hover { background: var(--hover-bg); }

.version-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.version-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.version-item-label { font-size: 13px; font-weight: 600; }
.version-item-meta  { font-size: 11px; color: var(--text-3); }

.version-item-restore {
  align-self: flex-end;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
  transition: opacity 0.2s;
}

.version-item-restore:hover { opacity: 0.85; }

/* ════════════════════════════════════════════
   FEATURE 5 — SHARE LINK EXPIRY
   ════════════════════════════════════════════ */
.share-expiry-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.share-expiry-label { font-size: 12px; color: var(--text-2); white-space: nowrap; }
.share-expiry-select {
  flex: 1;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border, rgba(255,255,255,.12));
  background: var(--surface, #1e1e2e);
  color: var(--text, #e4e4e7);
  font-size: 12px;
  cursor: pointer;
}

/* ════════════════════════════════════════════
   FEATURE 8 — COMMUNITY TEMPLATE CARDS
   ════════════════════════════════════════════ */
.community-template-card {
  border: 1px solid var(--border, rgba(255,255,255,.1));
  border-radius: 12px;
  padding: 12px;
  background: var(--bg-surface, #1e1e2e);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.community-template-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
}
.community-template-card .ctc-author {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-2);
  margin-top: 6px;
}
.community-template-card .ctc-avatar {
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.community-template-card .ctc-nodes {
  font-size: 10px;
  color: var(--text-3);
  margin-left: auto;
}

/* ════════════════════════════════════════════
   FEATURE 9 — EMBED WIDGET
   ════════════════════════════════════════════ */
.embed-code-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border, rgba(255,255,255,.08));
}
.embed-code-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.embed-code-textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border, rgba(255,255,255,.12));
  background: rgba(0,0,0,.3);
  color: var(--text, #e4e4e7);
  font-size: 11px;
  font-family: 'SF Mono', monospace;
  resize: none;
  box-sizing: border-box;
}
.embed-copy-btn {
  margin-top: 6px;
  width: 100%;
  padding: 7px;
  border-radius: 8px;
  border: none;
  background: var(--border, rgba(255,255,255,.1));
  color: var(--text, #e4e4e7);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.embed-copy-btn:hover { background: var(--brand, #7C6FFF); color: #fff; }

/* ════════════════════════════════════════════
   FEATURE 10 — AI CO-EDITING INDICATOR
   ════════════════════════════════════════════ */
.collab-ai-generating {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  background: linear-gradient(135deg, #7C6FFF, #a855f7);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 20px;
  border-radius: 24px;
  box-shadow: 0 4px 16px rgba(124, 111, 255, .5);
  pointer-events: none;
  animation: ai-pulse 1.6s ease-in-out infinite;
  white-space: nowrap;
}
@keyframes ai-pulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(124,111,255,.5); }
  50%       { box-shadow: 0 4px 32px rgba(124,111,255,.85); }
}

/* ════════════════════════════════════════════
   FEATURE 11 — ACTIVITY FEED PANEL
   ════════════════════════════════════════════ */
.activity-panel {
  position: fixed;
  top: 0; right: 0;
  width: 300px; height: 100vh;
  background: var(--panel-bg, #16161f);
  border-left: 1px solid var(--border, rgba(255,255,255,.08));
  z-index: 2200;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(.4,0,.2,1);
  box-shadow: -8px 0 32px rgba(0,0,0,.35);
}
.activity-panel.open { transform: translateX(0); }

.activity-panel-header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,.08));
  gap: 8px;
}
.activity-panel-title {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
}
.activity-panel-close {
  background: none;
  border: none;
  color: var(--text-2);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s;
}
.activity-panel-close:hover { background: rgba(255,255,255,.08); }

.activity-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  transition: background 0.12s;
}
.activity-item:hover { background: rgba(255,255,255,.04); }

.activity-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.activity-item-body { flex: 1; }
.activity-item-author { font-size: 12px; font-weight: 600; }
.activity-item-text   { font-size: 12px; color: var(--text-2); margin-top: 1px; }
.activity-item-time   { font-size: 10px; color: var(--text-3); margin-top: 2px; }

.activity-empty {
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
  padding: 32px 16px;
}

/* ════════════════════════════════════════════════════════════
   SET 4 — Collaboration Depth
   ════════════════════════════════════════════════════════════ */

/* Author chip — small avatar dot on recently-edited nodes */
.author-chip {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  border: 2px solid var(--surface, #fff);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  pointer-events: auto;
  z-index: 5;
  animation: authorChipPop 0.4s ease-out, authorChipFade 30s linear forwards;
}
@keyframes authorChipPop {
  from { transform: scale(0.4); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
@keyframes authorChipFade {
  0%, 70% { opacity: 1; }
  100%    { opacity: 0; }
}
.author-chip.fading { transition: opacity 0.5s ease; opacity: 0 !important; }
[data-theme="dark"] .author-chip { border-color: var(--surface, #1a1a24); }

/* Soft-lock icon — corner badge on nodes locked by another collaborator */
.collab-lock-icon {
  position: absolute;
  top: -10px;
  left: -10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 200, 60, 0.95);
  border: 2px solid var(--surface, #fff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  pointer-events: none;
  z-index: 5;
}
[data-theme="dark"] .collab-lock-icon { border-color: var(--surface, #1a1a24); }

/* Suggestions panel + button */
.suggestions-btn {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFB347 0%, #FF7849 100%);
  color: #fff;
  border: none;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(255, 120, 73, 0.45);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
}
.suggestions-btn .suggest-count {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #ff3b30;
  color: #fff;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface, #fff);
}
.suggestions-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 360px;
  max-width: 90vw;
  height: 100%;
  background: var(--surface, #1a1a24);
  color: var(--text, #fff);
  border-left: 1px solid var(--border, rgba(255,255,255,0.08));
  box-shadow: -10px 0 30px rgba(0,0,0,0.35);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  z-index: 9100;
  display: flex;
  flex-direction: column;
}
.suggestions-panel.open { transform: translateX(0); }
.suggestions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  font-weight: 700;
  font-size: 14px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
}
.suggestions-close {
  background: none;
  border: none;
  color: var(--text-2, #999);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.suggestions-close:hover { background: rgba(255,255,255,0.08); color: #fff; }
.suggestions-list { flex: 1; overflow: auto; padding: 12px; }
.suggestions-empty { text-align: center; color: var(--text-3, #777); padding: 24px; font-size: 13px; }
.suggestion-item {
  background: var(--surface2, rgba(255,255,255,0.04));
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}
.suggestion-meta { font-size: 12px; color: var(--text-2, #aaa); margin-bottom: 8px; }
.suggestion-meta strong { color: var(--text, #fff); }
.suggestion-diff { font-size: 13px; line-height: 1.5; }
.suggestion-from {
  background: rgba(255, 80, 80, 0.12);
  color: #ff8a8a;
  padding: 6px 10px;
  border-radius: 6px;
  margin-bottom: 4px;
  text-decoration: line-through;
}
.suggestion-to {
  background: rgba(80, 220, 130, 0.12);
  color: #6fdc97;
  padding: 6px 10px;
  border-radius: 6px;
}
.suggestion-tag { display: inline-block; width: 14px; font-weight: 800; }
.suggestion-actions { display: flex; gap: 8px; margin-top: 10px; }
.suggestion-approve, .suggestion-reject {
  flex: 1;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
}
.suggestion-approve { background: #34C759; color: #fff; }
.suggestion-approve:hover { background: #2eb84f; }
.suggestion-reject { background: rgba(255,255,255,0.06); color: var(--text-2, #aaa); border-color: var(--border, rgba(255,255,255,0.08)); }
.suggestion-reject:hover { background: rgba(255, 80, 80, 0.18); color: #ff8a8a; }

/* Activity-feed filter row */
.activity-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
  background: var(--surface2, rgba(255,255,255,0.03));
}
.activity-filter select,
.activity-filter input {
  flex: 1 1 auto;
  min-width: 90px;
  padding: 6px 8px;
  font-size: 12px;
  background: var(--surface, #1a1a24);
  color: var(--text, #fff);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 6px;
}
.activity-filter input { min-width: 110px; }
#activity-export-btn {
  flex: 0 0 auto;
  padding: 6px 10px;
  background: var(--brand, #7C6FFF);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
#activity-export-btn:hover { filter: brightness(1.08); }
