/* _aip */
._aip{position:relative; display:inline-flex; min-width:0;}
._aip-native{position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0;}
._aip-btn{display:inline-flex; align-items:center; gap:6px; max-width:100%; padding:7px 10px 7px 12px; border:1px solid rgba(15,23,42,.14); border-radius:8px; background:#fff; font-size:12.5px; font-weight:500; color:#334155; cursor:pointer; transition:border-color .14s, background .14s;}
._aip-btn:hover{border-color:rgba(15,23,42,.26); background:#f8fafc;}
._aip-btn:focus-visible{outline:2px solid #4f46e5; outline-offset:1px;}
._aip-btn[aria-expanded="true"]{border-color:#4f46e5; background:#fff;}
._aip-btn-text{overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
._aip-caret{width:14px; height:14px; flex:none; color:#94a3b8;}
._aip-btn[aria-expanded="true"] ._aip-caret{transform:rotate(180deg); color:#4f46e5;}
/* _aip-layer */
._aip-layer{position:fixed; z-index:100000; min-width:240px; max-width:340px; max-height:320px; overflow-y:auto; overscroll-behavior:contain; padding:6px; border:1px solid rgba(15,23,42,.12); border-radius:12px; background:#fff; box-shadow:0 12px 32px -8px rgba(15,23,42,.22), 0 2px 6px -2px rgba(15,23,42,.08);}
/* the layer scrolls when the list runs long - the default bar is too loud for a small panel */
._aip-layer::-webkit-scrollbar{width:8px;}
._aip-layer::-webkit-scrollbar-track{background:transparent;}
._aip-layer::-webkit-scrollbar-thumb{background:rgba(15,23,42,.12); border-radius:4px;}
._aip-layer::-webkit-scrollbar-thumb:hover{background:rgba(15,23,42,.2);}
/* _aip-slot */
._aip-slot{margin:6px 4px 2px; padding:7px 8px 6px; border-top:1px solid rgba(15,23,42,.08); font-size:12.5px; font-weight:700; color:#334155;}
._aip-slot:first-child{margin-top:0; border-top:0;}
/* _aip-layer */
._aip-layer.is-multi{min-width:270px; max-height:440px;}
._aip-group{padding:8px 10px 4px; font-size:11.5px; font-weight:600; letter-spacing:.02em; color:#94a3b8;}
._aip-group + ._aip-item{margin-top:0;}
._aip-item{display:block; width:100%; padding:8px 10px; border:0; border-radius:8px; background:transparent; font-size:13px; color:#334155; text-align:left; cursor:pointer; transition:background .12s, color .12s;}
._aip-item:hover{background:#f1f5f9;}
._aip-item:focus-visible{outline:2px solid #4f46e5; outline-offset:-2px;}
._aip-item.is-on{background:color-mix(in srgb, #4f46e5 9%, #fff); color:#4f46e5; font-weight:600;}
._aip-empty{padding:12px 10px; font-size:12.5px; color:#94a3b8; line-height:1.6;}
/* dark skin when the picker sits inside a dark AI panel - matches ai_assistant.css and ai_editor.css */
._am-panel ._aip-btn, ._ai-panel ._aip-btn{background:rgba(129,140,248,.12); border:1px solid rgba(165,180,252,.3); color:#c3c8fb;}
._am-panel ._aip-btn:hover, ._ai-panel ._aip-btn:hover{background:rgba(129,140,248,.22); border-color:rgba(165,180,252,.5);}
._am-panel ._aip-btn[aria-expanded="true"], ._ai-panel ._aip-btn[aria-expanded="true"]{background:rgba(129,140,248,.22); border-color:rgba(196,167,255,.7);}
._am-panel ._aip-caret, ._ai-panel ._aip-caret{color:rgba(196,167,255,.8);}
._am-panel ._aip-btn[aria-expanded="true"] ._aip-caret, ._ai-panel ._aip-btn[aria-expanded="true"] ._aip-caret{color:#e9d9ff;}
/* the layer is portalled to body so it cannot inherit - tag it by the open button instead */
._aip-layer.is-dark{background:#1d2050; border-color:rgba(165,180,252,.28); box-shadow:0 20px 48px -18px rgba(12,10,40,.75);}
._aip-layer.is-dark ._aip-slot{color:#c9cdfb; border-top-color:rgba(255,255,255,.1);}
._aip-layer.is-dark ._aip-group{color:rgba(255,255,255,.5);}
._aip-layer.is-dark ._aip-item{color:rgba(255,255,255,.85);}
._aip-layer.is-dark ._aip-item:hover{background:rgba(255,255,255,.08);}
._aip-layer.is-dark ._aip-item.is-on{background:rgba(129,140,248,.22); color:#e9d9ff;}
._aip-layer.is-dark ._aip-empty{color:rgba(255,255,255,.45);}
._aip-layer.is-dark::-webkit-scrollbar-thumb{background:rgba(255,255,255,.16);}
._aip-layer.is-dark::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,.28);}
