/* ================================================================
   File Mention — popover, import menu, and mention chips
   ================================================================ */

/* ── Import Menu ── */
.fm-import-menu {
  position: fixed;
  z-index: 9001;
  background: var(--card-bg, #161b22);
  border: 1px solid var(--border, #30363d);
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
  padding: 4px;
  min-width: 168px;
}

.fm-import-menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary, #e6edf3);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  border-radius: 7px;
  transition: background 0.1s;
  min-height: 44px;
}

.fm-import-menu-item:hover,
.fm-import-menu-item:focus {
  background: var(--button-hover-bg, #21262d);
  outline: none;
}

.fm-import-menu-item svg {
  flex-shrink: 0;
  color: var(--text-secondary, #8b949e);
}

/* ── Desktop Popover ── */
.fm-popover {
  position: fixed;
  z-index: 9000;
  width: 320px;
  max-height: 400px;
  background: var(--card-bg, #161b22);
  border: 1px solid var(--border, #30363d);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.fm-popover-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border, #30363d);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.fm-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary, #8b949e);
  min-height: 22px;
  overflow: hidden;
}

.fm-back {
  background: none;
  border: none;
  color: var(--text-secondary, #8b949e);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  min-height: 28px;
  min-width: 28px;
  justify-content: center;
}

.fm-back:hover {
  color: var(--text-primary, #e6edf3);
  background: var(--button-hover-bg, #21262d);
}

.fm-path {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: rtl;
  text-align: left;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
}

.fm-search {
  width: 100%;
  background: var(--input-bg, #0d1117);
  border: 1px solid var(--border, #30363d);
  border-radius: 6px;
  color: var(--text-primary, #e6edf3);
  font-size: 13px;
  padding: 7px 10px;
  outline: none;
  box-sizing: border-box;
  -webkit-appearance: none;
}

.fm-search:focus {
  border-color: var(--accent, #58a6ff);
}

.fm-search::placeholder {
  color: var(--text-secondary, #8b949e);
}

.fm-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
  min-height: 60px;
}

.fm-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary, #e6edf3);
  min-height: 36px;
  transition: background 0.08s;
  user-select: none;
  -webkit-user-select: none;
}

.fm-entry:hover,
.fm-entry:focus {
  background: var(--button-hover-bg, #21262d);
  outline: none;
}

.fm-icon {
  width: 16px;
  text-align: center;
  color: var(--text-secondary, #8b949e);
  font-size: 10px;
  flex-shrink: 0;
  line-height: 1;
}

.fm-dir .fm-icon {
  color: var(--accent, #58a6ff);
}

.fm-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fm-name mark {
  background: rgba(88, 166, 255, 0.25);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

.fm-size {
  font-size: 11px;
  color: var(--text-secondary, #8b949e);
  flex-shrink: 0;
}

.fm-empty {
  padding: 24px 12px;
  text-align: center;
  color: var(--text-secondary, #8b949e);
  font-size: 13px;
}

/* ── Mention Chips ── */
.fm-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(88, 166, 255, 0.10);
  border: 1px solid rgba(88, 166, 255, 0.28);
  border-radius: 6px;
  padding: 4px 6px 4px 8px;
  font-size: 12px;
  color: var(--accent, #58a6ff);
  max-width: 240px;
  vertical-align: middle;
}

.fm-chip-icon {
  flex-shrink: 0;
  opacity: 0.75;
}

.fm-chip-path {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: rtl;
  text-align: left;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  max-width: 180px;
}

.fm-chip-remove {
  background: none;
  border: none;
  color: var(--text-secondary, #8b949e);
  cursor: pointer;
  font-size: 14px;
  padding: 0 2px;
  line-height: 1;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  min-height: 18px;
  border-radius: 3px;
}

.fm-chip-remove:hover {
  color: var(--danger, #f85149);
  background: rgba(248, 81, 73, 0.12);
}

/* ── Pick-mode banner shown in folder tree ── */
.ft-pick-mode-banner {
  background: rgba(88, 166, 255, 0.10);
  border-bottom: 1px solid rgba(88, 166, 255, 0.25);
  color: var(--accent, #58a6ff);
  font-size: 12px;
  padding: 8px 12px;
  text-align: center;
  font-weight: 500;
  flex-shrink: 0;
}
