/* Right-click context menu — floating panel positioned at the cursor.
   Mounted once in base.html; populated/positioned by context_menu.js
   on each contextmenu event. Submenus open to the right; the JS clamps
   either to stay inside the viewport. */

.ctx-menu {
  position: fixed;
  z-index: 10000;
  margin: 0;
  padding: 4px;
  list-style: none;
  min-width: 180px;
  max-width: 280px;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  font-size: 13px;
  user-select: none;
}
.ctx-menu[hidden] { display: none !important; }

.ctx-item {
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ctx-item:hover:not(.ctx-disabled) { background: rgba(99, 102, 241, 0.12); }
.ctx-item:focus { outline: none; background: rgba(99, 102, 241, 0.12); }
.ctx-item.ctx-disabled { color: var(--fg-muted); cursor: not-allowed; }
.ctx-item.ctx-danger { color: #dc2626; }
.ctx-item.ctx-danger:hover { background: #fef2f2; }
.ctx-has-submenu .ctx-caret { color: var(--fg-muted); font-size: 14px; line-height: 1; }
.ctx-item.ctx-meta {
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  padding: 4px 12px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
  border-radius: 0;
  color: var(--fg-muted);
}

.ctx-separator {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
  pointer-events: none;
}

.ctx-submenu {
  position: absolute;
  margin: 0;
  padding: 4px;
  list-style: none;
  min-width: 180px;
  max-width: 280px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  max-height: 60vh;
  overflow-y: auto;
}
