/* Copyright 2026 CLEALINK TECHNOLOGY CO.,LTD. All rights reserved. */

/* Context menu, and its bottom-sheet form on small touch screens. */

.menu {
  position: fixed; z-index: 400; min-width: 220px; max-width: min(360px, calc(100vw - 8px)); max-height: calc(100vh - 8px); overflow: auto;
  background: var(--raised); border: 1px solid var(--border-strong); border-radius: var(--r-lg); padding: 6px;
  box-shadow: var(--shadow-2); display: flex; flex-direction: column; font-size: var(--fs-13); color: var(--text);
  animation: menu-in var(--t-fast) var(--ease);
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-3px); } }
.menu:focus-visible { outline: none; }
.menu-item {
  appearance: none; border: 0; background: none; color: inherit; text-align: left; min-height: 32px; padding: 0 10px 0 6px;
  border-radius: var(--r-sm); font-size: var(--fs-13); display: flex; align-items: center; gap: 6px; width: 100%;
}
.menu-lead { width: 18px; height: 16px; display: inline-flex; align-items: center; justify-content: center; flex: none; color: var(--muted); }
.menu-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-hint { color: var(--muted); font-size: var(--fs-11); margin-left: 18px; white-space: nowrap; flex: none; }
:root[data-hover="1"] .menu-item:hover:not([aria-disabled="true"]), .menu-item:focus-visible { background: var(--on-bg); outline: none; }
.menu-item:focus-visible { box-shadow: inset 0 0 0 1px var(--on-border); }
.menu-item.danger, .menu-item.danger .menu-lead { color: var(--red-soft); }
.menu-item[aria-disabled="true"] { color: var(--faint); cursor: not-allowed; }
.menu-item[aria-disabled="true"] .menu-label { opacity: .75; }
.menu hr { border: 0; border-top: 1px solid var(--border-strong); margin: 5px 4px; width: auto; align-self: stretch; }
.menu-group { font-size: var(--fs-11); color: var(--muted); padding: 6px 10px 2px; }

.menu-scrim { position: fixed; inset: 0; z-index: 399; background: var(--scrim); }
.menu-sheet {
  left: 0; right: 0; bottom: 0; top: auto; max-width: none; max-height: 78vh; border-radius: var(--r-3xl) var(--r-3xl) 0 0;
  border-width: 1px 0 0; padding: 10px 10px calc(14px + env(safe-area-inset-bottom)); animation: sheet-in var(--t-med) var(--ease);
}
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } }
.menu-sheet::before { content: ""; width: 36px; height: 4px; border-radius: 2px; background: var(--border-strong); align-self: center; margin: 0 0 8px; flex: none; }
/* A long sheet scrolls; its items keep their finger-sized height instead of being squeezed. */
.menu-sheet .menu-item { min-height: 48px; flex: none; font-size: var(--fs-15); padding: 0 12px 0 8px; gap: 10px; }
.menu-sheet .menu-hint { font-size: var(--fs-12); }
