/* Our right-click menu (context-menu.js) and the yellow text selection, on every page. */
html:root ::selection { background: #f5d90a; color: #111111; }

.cm {
    --cm-bg: #ffffff; --cm-text: #16161a; --cm-muted: #8a8a94; --cm-line: #ececf0; --cm-on: #f2f2f4; --cm-border: #e4e4e8;
    position: fixed; z-index: 2147483000; display: none; min-width: 232px; max-width: 300px; padding: 6px;
    border: 1px solid var(--cm-border); border-radius: 12px; background: var(--cm-bg); color: var(--cm-text);
    font: 500 13px/1.2 "Geist", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: -.005em;
    box-shadow: 0 18px 50px -12px rgba(0, 0, 0, .28), 0 2px 6px rgba(0, 0, 0, .06); outline: none;
    user-select: none; -webkit-user-select: none;
}
:root[data-theme="dark"] .cm { --cm-bg: #161617; --cm-text: #f2f2f3; --cm-muted: #7c7c86; --cm-line: #252527; --cm-on: #232325; --cm-border: #2a2a2d; box-shadow: 0 20px 60px -10px rgba(0, 0, 0, .7); }
.cm.is-open { display: block; animation: cm-in .12s ease-out; }
@keyframes cm-in { from { opacity: 0; transform: scale(.98); } }
@media (prefers-reduced-motion: reduce) { .cm.is-open { animation: none; } }

.cm-row { display: flex; gap: 4px; padding: 2px; }
.cm-ico { display: grid; place-items: center; flex: 1; height: 32px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--cm-text); cursor: pointer; }
.cm-ico svg { width: 16px; height: 16px; }
.cm-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--cm-text); font: inherit; text-align: left; cursor: pointer; }
.cm-item svg { flex: none; width: 15px; height: 15px; color: var(--cm-muted); }
.cm-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-item kbd { color: var(--cm-muted); font: inherit; font-size: 11.5px; }
.cm-item.is-on, .cm-ico.is-on { background: var(--cm-on); }
.cm-item:disabled, .cm-ico:disabled { opacity: .35; cursor: default; }
.cm-sep { height: 1px; margin: 5px 4px; background: var(--cm-line); }

.cm-toast {
    position: fixed; left: 50%; bottom: 28px; z-index: 2147483001; padding: 10px 16px; border-radius: 10px;
    background: #16161a; color: #fff; font: 500 13px/1.2 "Geist", "Inter", system-ui, sans-serif;
    opacity: 0; transform: translate(-50%, 8px); pointer-events: none; transition: opacity .18s, transform .18s;
}
.cm-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
