/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Context Selector — @-mention pills & floating dropdown
   The dropdown uses .ii-popper-menu base classes from components.css
   (animation, shadow, border, dark-mode are all inherited).
   Only layout overrides and pill styles live here.
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* ── Dropdown: layout overrides on top of .ii-popper-menu ─── */
.ii-ctx-dropdown {
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ii-ctx-list {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ── "Add Assets" sticky footer ─────────────────────────────── */
.ii-ctx-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--ii-border);
    padding-top: 4px;
    margin-top: 4px;
}

.ii-ctx-add-assets-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    padding: 6px 8px;
    border: none;
    background: transparent;
    color: var(--ii-accent);
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--ii-radius-sm);
    cursor: pointer;
    transition: background 0.12s;
    font-family: inherit;
}

.ii-ctx-add-assets-btn:hover {
    background: rgba(37, 99, 235, 0.07);
}

[data-theme="dark"] .ii-ctx-add-assets-btn:hover {
    background: rgba(130, 175, 255, 0.1);
}

.ii-ctx-add-assets-btn-text {}


/* ── Dropdown items — extend .ii-popper-menu-item ──────────── */
.ii-ctx-item.ii-popper-menu-item {
    padding: 6px 10px;
    gap: 10px;
    padding-right: 10px;
}

.ii-ctx-item.ii-popper-menu-item.is-active {
    background: var(--ii-bg-hover);
    color: var(--ii-text-primary);
}

.ii-ctx-thumb {
    width: 32px;
    height: 32px;
    border-radius: var(--ii-radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--ii-border);
}

.ii-ctx-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--ii-radius-sm);
    background: var(--ii-bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--ii-text-secondary);
}

.ii-ctx-item-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.ii-ctx-item-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--ii-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ii-ctx-subtitle {
    font-size: 10.5px;
    color: var(--ii-text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ii-ctx-empty {
    font-size: 13px;
    color: var(--ii-text-tertiary);
    text-align: center;
}

.ii-ctx-variant-indent {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
    display: block;
    position: relative;
}

.ii-ctx-variant-indent::before {
    content: '';
    position: absolute;
    left: 4px;
    top: -8px;
    width: 1px;
    height: 16px;
    background: var(--ii-border);
    border-radius: 1px;
}

.ii-ctx-variant-indent::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 8px;
    width: 8px;
    height: 1px;
    background: var(--ii-border);
    border-radius: 1px;
}

.ii-ctx-variant-badge {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 4px;
    background: rgba(99, 150, 255, 0.15);
    color: rgb(37, 99, 235);
    margin-right: 5px;
    flex-shrink: 0;
    vertical-align: middle;
    letter-spacing: 0.02em;
}

[data-theme="dark"] .ii-ctx-variant-badge {
    color: rgb(130, 175, 255);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   @-mention Pills
   Design: pill-shape, very subtle per-type RGBA tint on the
   background + border, type-accent color on the @ glyph only,
   primary text for the label — matches the AI Insights card
   "cool-blue tint" aesthetic from the design system.
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.ii-mention-pill {
    --pill-rgb: 37, 99, 235;

    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 5px 2px 3px;
    border-radius: var(--ii-radius-sm);
    background: rgba(var(--pill-rgb), 0.08);
    border: 1px solid rgba(var(--pill-rgb), 0.22);
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    vertical-align: middle;
    user-select: none;
    white-space: nowrap;
    cursor: default;
    margin: 0 1px;
    position: relative;
    top: -1px;
    transition: border-color 0.15s;
}

/* Previous-generation pill gets a distinct cyan accent */
.ii-mention-pill--prev {
    --pill-rgb: 8, 145, 178;
}

.ii-mention-thumb {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
}

.ii-mention-icon {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(var(--pill-rgb), 0.8);
    flex-shrink: 0;
}

.ii-mention-label {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    max-width: 130px;
    line-height: 1.125;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* @ glyph: accent color signals the type */
.ii-mention-at {
    font-weight: 600;
    flex-shrink: 0;
}

/* Title: neutral primary text — readable on any background */
.ii-mention-title {
    color: var(--ii-text-primary);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Remove button: hidden until pill is hovered */
.ii-mention-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 13px;
    height: 13px;
    border: none;
    background: transparent;
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    color: var(--ii-text-tertiary);
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
    line-height: 1;
}

.ii-mention-remove:hover {
    color: rgb(var(--pill-rgb));
}

/* Dark mode: slightly higher opacities so the tints read on charcoal */
[data-theme="dark"] .ii-mention-pill {
    background: rgba(var(--pill-rgb), 0.12);
    border-color: rgba(var(--pill-rgb), 0.28);
}

[data-theme="dark"] .ii-mention-title {
    color: var(--ii-text-primary);
}