.aip3-binding {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: stretch;
    width: 100%;
    position: relative;
}

.aip3-binding > input {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    width: 100%;
    border-radius: 0 .375rem .375rem 0 !important;
}

.aip3-binding-button {
    width: 46px;
    grid-column: 1;
    grid-row: 1;
    position: relative;
    min-width: 46px;
    border: 1px solid rgba(148, 163, 184, .35);
    border-right: 0;
    border-radius: .375rem 0 0 .375rem;
    background: rgba(15, 23, 42, .24);
    color: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.15rem;
    transition: background .16s ease, transform .16s ease;
}
.aip3-binding.aip3-inline-open > input {
    border-bottom-right-radius: 0 !important;
}

.aip3-binding.aip3-inline-open > .aip3-binding-button {
    border-bottom-left-radius: 0;
}
.aip3-inline-results {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    min-height: 58px;
    display: flex;
    align-items: stretch;
    gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid rgba(148, 163, 184, .32);
    border-top: 0;
    border-radius: 0 0 .5rem .5rem;
    background: #30353b;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .26);
    scrollbar-width: thin;
    z-index: 4;
}

.aip3-inline-results[hidden] {
    display: none !important;
}

.aip3-inline-candidate,
.aip3-inline-more {
    min-width: 74px;
    min-height: 58px;
    flex: 1 0 74px;
    border: 0;
    background: transparent;
    color: #f8fafc;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .14s ease, color .14s ease;
}

.aip3-inline-candidate:hover,
.aip3-inline-candidate:focus-visible,
.aip3-inline-candidate.active,
.aip3-inline-more:hover,
.aip3-inline-more:focus-visible {
    background: rgba(129, 140, 248, .25);
    color: #fff;
    outline: none;
}

.aip3-inline-candidate-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.22rem;
}

.aip3-inline-candidate-icon i {
    font-size: 1.22rem;
}

.aip3-inline-candidate-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.aip3-inline-more {
    font-size: 0;
}

.aip3-inline-more::before {
    content: '\2026';
    font-size: 1.45rem;
    line-height: 1;
}

.aip3-binding-button:hover,
.aip3-binding-button:focus-visible {
    background: rgba(99, 102, 241, .28);
    transform: translateY(-1px);
    outline: none;
}

.aip3-binding-button[data-icon-source="auto"]::after {
    content: '✦';
    position: absolute;
    left: 31px;
    top: 2px;
    font-size: .56rem;
    color: #a78bfa;
}

.aip3-root {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e2e8f0;
}

.aip3-root[hidden] { display: none !important; }

.aip3-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, .66);
    backdrop-filter: blur(4px);
}

.aip3-dialog {
    position: relative;
    z-index: 1;
    width: min(720px, calc(100vw - 28px));
    max-height: min(720px, calc(100vh - 28px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, .28);
    border-radius: 18px;
    background: #111827;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .48);
}

.aip3-header,
.aip3-toolbar,
.aip3-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
}

.aip3-header { justify-content: space-between; border-bottom: 1px solid rgba(148, 163, 184, .14); }
.aip3-header h2 { margin: 0; font-size: 1.05rem; font-weight: 650; }
.aip3-close { border: 0; background: transparent; color: #cbd5e1; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.aip3-search { flex: 1; min-width: 0; border: 1px solid rgba(148, 163, 184, .3); border-radius: 9px; background: #0f172a; color: #f8fafc; padding: 9px 11px; }
.aip3-search:focus { outline: 2px solid #818cf8; outline-offset: 1px; }
.aip3-provider-tabs { display: flex; gap: 4px; }
.aip3-provider-mode {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    min-width: 240px;
    margin: 0;
    padding: 0;
    border: 0;
}
.aip3-provider-mode legend { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.aip3-provider-mode-options { display: flex; gap: 4px; flex-wrap: wrap; }
.aip3-provider-mode-option { border: 1px solid transparent; border-radius: 8px; padding: 7px 9px; background: transparent; color: #94a3b8; cursor: pointer; }
.aip3-provider-mode-option:hover, .aip3-provider-mode-option:focus-visible { color: #eef2ff; background: rgba(99, 102, 241, .14); outline: none; }
.aip3-provider-mode-option.active { border-color: rgba(129, 140, 248, .7); background: rgba(99, 102, 241, .24); color: #eef2ff; }
.aip3-provider-global, .aip3-automatic-toggle { display: inline-flex; align-items: center; gap: 6px; color: #94a3b8; font-size: .75rem; cursor: pointer; }
.aip3-provider-global input, .aip3-automatic-toggle input { accent-color: #6366f1; }
.aip3-provider-section-label { grid-column: 1 / -1; padding: 4px 2px 0; color: #94a3b8; font-size: .72rem; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; }
.aip3-footer .aip3-cancel { background: #1e293b; color: #cbd5e1; }

.aip3-provider-tab { border: 1px solid transparent; border-radius: 8px; padding: 7px 9px; background: transparent; color: #94a3b8; cursor: pointer; }
.aip3-provider-tab.active { border-color: rgba(129, 140, 248, .55); background: rgba(99, 102, 241, .2); color: #eef2ff; }
.aip3-section-label { padding: 0 16px 8px; color: #94a3b8; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.aip3-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(102px, 1fr)); gap: 8px; overflow-y: auto; padding: 0 16px 16px; min-height: 110px; }
.aip3-candidate { min-height: 86px; border: 1px solid transparent; border-radius: 11px; background: rgba(30, 41, 59, .72); color: #cbd5e1; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 8px; }
.aip3-candidate:hover, .aip3-candidate:focus-visible, .aip3-candidate.selected { border-color: #818cf8; background: rgba(99, 102, 241, .22); outline: none; }
.aip3-candidate-icon { min-height: 30px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.65rem; }
.aip3-candidate-icon i { font-size: 1.35rem; }
.aip3-candidate-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .72rem; }
.aip3-empty { grid-column: 1 / -1; padding: 32px 10px; text-align: center; color: #94a3b8; }
.aip3-footer { justify-content: space-between; border-top: 1px solid rgba(148, 163, 184, .14); }
.aip3-footer button { border: 1px solid rgba(148, 163, 184, .3); border-radius: 8px; padding: 8px 11px; background: #1e293b; color: #cbd5e1; cursor: pointer; }
.aip3-footer .aip3-select { background: #4f46e5; border-color: #6366f1; color: #fff; }
.aip3-footer button:disabled { opacity: .45; cursor: not-allowed; }

@media (max-width: 767px) {
    .aip3-root { align-items: flex-end; }
    .aip3-dialog { width: 100%; max-height: 88vh; border-radius: 18px 18px 0 0; }
    .aip3-toolbar { flex-wrap: wrap; }
    .aip3-provider-tabs { width: 100%; }
    .aip3-provider-tab { flex: 1; }
}
.subitem-icon { border: 0; background: transparent; color: inherit; width: 24px; min-width: 24px; padding: 2px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; opacity: .82; }
.subitem-icon:hover, .subitem-icon:focus-visible { opacity: 1; color: #a5b4fc; outline: 1px solid rgba(129, 140, 248, .55); border-radius: 6px; }
.subitem-icon.completed { opacity: .55; }
.subitem-icon i { font-size: .82rem; }
.subitem-icon:not(:has(i)) { font-size: .9rem; }


/* AwesomePicker 3.2 hierarchy, provider memory, and appearance controls. */
.aip3-header-actions { display: inline-flex; align-items: center; gap: 6px; }
.aip3-settings { border: 0; background: transparent; color: #cbd5e1; font-size: 1rem; cursor: pointer; }
.aip3-toolbar { position: relative; align-items: stretch; }
.aip3-search { width: 100%; flex-basis: 100%; }
.aip3-provider-mode { flex: 1 1 auto; order: 2; margin: 0; padding: 0; border: 0; }
.aip3-provider-global, .aip3-automatic-toggle { display: none !important; }
.aip3-provider-mode-options { justify-content: flex-start; }
.aip3-provider-mode-option { min-width: 86px; }
.aip3-settings-popover { position: absolute; top: 46px; right: 16px; z-index: 4; display: grid; gap: 9px; width: min(320px, calc(100% - 32px)); padding: 12px; border: 1px solid rgba(148,163,184,.28); border-radius: 10px; background: rgba(15,23,42,.98); box-shadow: 0 16px 40px rgba(0,0,0,.35); color: #cbd5e1; font-size: .78rem; }
.aip3-settings-popover[hidden], .aip3-color-popover[hidden] { display: none !important; }
.aip3-settings-popover label { display: flex; align-items: center; gap: 8px; }
.aip3-selection-summary { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 9px 16px; color: #cbd5e1; border-top: 1px solid rgba(148,163,184,.12); }
.aip3-selected-icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; font-size: 1.2rem; }
.aip3-selected-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; }
.aip3-footer-left { position: relative; display: inline-flex; align-items: center; gap: 8px; }
.aip3-color-swatch { width: 28px; height: 28px; padding: 0; border: 2px solid rgba(255,255,255,.75); border-radius: 50%; background: currentColor; cursor: pointer; }
.aip3-color-swatch:disabled { opacity: .35; cursor: not-allowed; }
.aip3-color-popover { position: absolute; left: 0; bottom: 40px; z-index: 5; display: grid; gap: 8px; min-width: 240px; padding: 12px; border: 1px solid rgba(148,163,184,.28); border-radius: 10px; background: rgba(15,23,42,.98); color: #cbd5e1; box-shadow: 0 16px 40px rgba(0,0,0,.4); }
.aip3-color-options { display: flex; flex-wrap: wrap; gap: 5px; }
.aip3-color-choice { border: 2px solid currentColor; border-radius: 999px; padding: 4px 8px; background: transparent; color: #cbd5e1; font-size: .72rem; cursor: pointer; }
.aip3-color-custom { width: 42px; height: 30px; border: 0; background: transparent; cursor: pointer; }
.aip3-footer { align-items: center; gap: 8px; }
@media (max-width: 767.98px) { .aip3-dialog { width: 100%; } .aip3-provider-mode-option { flex: 1 1 0; min-width: 0; } .aip3-color-popover { left: -8px; } }

.aip3-color-choice { display: inline-flex; align-items: center; gap: 5px; }
.aip3-color-choice-icon { display: inline-flex; font-size: .95rem; }
