/* The policy belongs only to the application document, never guest websites or OS chrome. */
.kb-selection-policy { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.kb-selection-policy :is(input,textarea,select,[contenteditable]:not([contenteditable="false"]),.xterm,.monaco-editor,.CodeMirror,.ace_editor,[data-kb-selection="native"],.ai-tool-call-code,.ai-tool-call-output,.ai-message-error,.ai-project-folder-path,.clip-source-link,.plugin-auth-code,.select-text,.select-all,pre,code,table,.ai-tool-result,.ai-error-message,.kb-dialog-hint,.md-reader-url-error,#detailMain,#detailPanelMain,#aiChatMessages .ai-message-content,[data-kb-selection="content"]) { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
/* An explicit native value preserves its own editing/atomic selection rules, including editor chips. */
.kb-managed-selection :is(#detailMain,#detailPanelMain,#aiChatMessages .ai-message-content,[data-kb-selection="content"]):not(:is(input,textarea,select,[contenteditable]:not([contenteditable="false"]),.xterm,.monaco-editor,.CodeMirror,.ace_editor,[data-kb-selection="native"],.ai-tool-call-code,.ai-tool-call-output,.ai-message-error,.ai-project-folder-path,.clip-source-link,.plugin-auth-code,.select-text,.select-all)),
.kb-managed-selection :is(#detailMain,#detailPanelMain,#aiChatMessages .ai-message-content,[data-kb-selection="content"]) :not(:is(input,textarea,select,[contenteditable]:not([contenteditable="false"]),.xterm,.monaco-editor,.CodeMirror,.ace_editor,[data-kb-selection="native"],.ai-tool-call-code,.ai-tool-call-output,.ai-message-error,.ai-project-folder-path,.clip-source-link,.plugin-auth-code,.select-text,.select-all)):not(:is(input,textarea,select,[contenteditable]:not([contenteditable="false"]),.xterm,.monaco-editor,.CodeMirror,.ace_editor,[data-kb-selection="native"],.ai-tool-call-code,.ai-tool-call-output,.ai-message-error,.ai-project-folder-path,.clip-source-link,.plugin-auth-code,.select-text,.select-all) *) { -webkit-user-select: none !important; user-select: none !important; -webkit-touch-callout: none; }
.kb-selection-policy :is(.plugin-auth-code,.select-all) { -webkit-user-select: all; user-select: all; }
.kb-selection-policy :is(button,[role="button"],[role="tab"]):not([contenteditable]:not([contenteditable="false"]) *),
.kb-selection-policy :is(button,[role="button"],[role="tab"]) :not([contenteditable]:not([contenteditable="false"]) *) { -webkit-user-select: none; user-select: none; }
.kb-selection-policy img { -webkit-user-drag: none; -webkit-touch-callout: none; }
.kb-selection-overlay { position: fixed; inset: 0; z-index: calc(var(--z-tooltip, 3000) - 1); pointer-events: none; }
.kb-selection-mark { position: absolute; background: rgba(59,130,246,.28); pointer-events: none; }
.kb-selection-handle { position: absolute; transform: translate(-50%,-5px); width: 44px; height: 44px; min-width: 44px !important; min-height: 44px !important; padding: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; pointer-events: auto; touch-action: none; }
.kb-selection-handle::after { content: ''; display: block; position: absolute; left: 15px; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: #3b82f6; margin: 0 !important; }
.kb-selection-handle:focus-visible::after { outline: 2px solid var(--kb-accent,#2563eb); outline-offset: 4px; }
