/* ===================================================================
   context-menu.css — v1.5.2.5
   Reusable right-click / long-press context menu (js/context-menu.js).

   Deliberately mirrors the palette, radii and shadow already used by
   the existing kebab popup (.mn-card-menu in css/style.css) instead
   of inventing a second visual language for menus — same
   --surface-2/--line/--bone/--bone-dim/--ember tokens. The only new
   things here are: a viewport-fixed position (it isn't anchored to
   one card), a fade+scale entrance, and an optional cover+title
   header row.
   =================================================================== */

.mn-ctx-menu {
  position: fixed;
  z-index: 1000;
  min-width: 220px;
  max-width: 280px;
  background: rgba(21, 21, 26, 0.98);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  overflow: hidden;
  padding: 6px;
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 0.14s var(--ease), transform 0.14s var(--ease);
  font-family: var(--font-body);
}

.mn-ctx-menu.mn-ctx-open {
  opacity: 1;
  transform: scale(1);
}

.mn-ctx-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 10px;
}

.mn-ctx-header img,
.mn-ctx-header-noimg {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-3);
  flex: none;
}

.mn-ctx-header-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.mn-ctx-header-text strong {
  color: var(--bone);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mn-ctx-header-text small {
  color: var(--bone-dim);
  font-size: var(--text-xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mn-ctx-divider {
  height: 1px;
  background: var(--line);
  margin: 4px 2px;
}

.mn-ctx-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--bone);
  text-align: start;
  padding: 9px 10px;
  font-size: var(--text-sm);
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.mn-ctx-item:hover,
.mn-ctx-item:focus-visible {
  background: var(--surface-2);
  color: var(--ember-bright);
  outline: none;
}

.mn-ctx-icon {
  flex: none;
  width: 18px;
  text-align: center;
  font-size: 14px;
  line-height: 1;
}

.mn-ctx-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mn-ctx-item.mn-ctx-danger { color: #ff8a65; }
.mn-ctx-item.mn-ctx-danger:hover { background: rgba(255, 90, 90, 0.12); color: #ff5a5a; }

/* Touch devices: same breakpoint/treatment already used for
   .mn-card-menu in css/style.css — bigger tap targets. */
@media (hover: none) and (pointer: coarse) {
  .mn-ctx-menu { min-width: 240px; max-width: min(92vw, 320px); }
  .mn-ctx-item { padding: 12px 10px; font-size: var(--text-base); }
}

@media (max-width: 380px) {
  .mn-ctx-menu { max-width: 88vw; }
}
@media (max-width: 768px) {
  .mn-ctx-menu {
    max-width: 280px;
    max-height: 70vh;
    overflow-y: auto;
  }

  .mn-ctx-header {
    padding: 6px 6px 8px;
    gap: 8px;
  }

  .mn-ctx-header img,
  .mn-ctx-header-noimg {
    width: 44px;
    height: 44px;
  }

  .mn-ctx-header-text strong {
    font-size: 14px;
  }

  .mn-ctx-header-text small {
    font-size: 12px;
  }

  .mn-ctx-item {
    padding: 8px 12px;
    min-height: 40px;
  }

  .mn-ctx-icon {
    width: 16px;
    font-size: 13px;
  }
}