/* BioStudio AI — Windows 11 style context menus */

.ctx-menu {
  position: fixed;
  z-index: 20000;
  min-width: 220px;
  max-width: 320px;
  padding: 6px;
  border-radius: 10px;
  background: #ffffff;
  backdrop-filter: blur(34px) saturate(1.6);
  -webkit-backdrop-filter: blur(34px) saturate(1.6);
  border: 1px solid var(--menu-border, rgba(15, 23, 42, 0.12));
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28), 0 0 0 0.5px rgba(0, 0, 0, 0.08);
  color: #132238;
  color-scheme: light;
  transform-origin: top left;
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.06s ease, transform 0.06s ease;
  will-change: opacity, transform;
}
.ctx-menu.ctx-in { opacity: 1; transform: scale(1); }

.ctx-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 34px;
  padding: 0 10px 0 8px;
  border-radius: 6px;
  font-size: 13px;
  text-align: left;
  color: #132238;
  white-space: nowrap;
}
.ctx-item:hover:not([disabled]) { background: rgba(15, 23, 42, 0.06); }
.ctx-item[disabled] { opacity: 0.4; cursor: default; }
.ctx-item.danger:hover:not([disabled]) { background: rgba(232, 17, 35, 0.12); color: #d11; }

.ctx-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
}
.ctx-icon .icon { width: 16px; height: 16px; }
.ctx-check { width: 16px; height: 16px; color: var(--accent); }
.ctx-check svg { width: 100%; height: 100%; }

.ctx-swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.28);
  background: transparent;
}
.ctx-swatch.is-empty {
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ink-soft) 70%, transparent);
}
.ctx-swatch.is-checked {
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.3), 0 0 0 2px var(--accent, #2563eb);
}

.ctx-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }

.ctx-shortcut {
  font-size: 11.5px;
  color: var(--ink-soft);
  letter-spacing: 0.3px;
}
.ctx-arrow {
  width: 14px;
  height: 14px;
  color: var(--ink-soft);
  display: grid;
  place-items: center;
}
.ctx-arrow .icon { width: 14px; height: 14px; }

.ctx-sep {
  height: 1px;
  margin: 5px 8px;
  background: var(--menu-border, rgba(0, 0, 0, 0.1));
}

.ctx-header {
  padding: 6px 10px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* Right-click menus stay white even in dark OS / app themes. Theme files
   and portaled app-color tokens otherwise paint a near-black acrylic fill. */
html body .ctx-menu[role="menu"] {
  --menu-bg: #ffffff !important;
  --menu-border: rgba(15, 23, 42, 0.12) !important;
  --menu-hover: rgba(15, 23, 42, 0.06) !important;
  --ink: #132238 !important;
  --ink-soft: #5b6b80 !important;
  background: #ffffff !important;
  color: #132238 !important;
  color-scheme: light;
}
html body .ctx-menu[role="menu"] * {
  --ink: #132238 !important;
  --ink-soft: #5b6b80 !important;
}
