/* A single responsive plugin surface, independent of the hidden composer trigger. */
body #plugin-popover {
  position:fixed!important;inset:0!important;
  width:100vw!important;height:100dvh!important;box-sizing:border-box;
  max-width:none!important;max-height:none!important;margin:0 auto;
  padding:24px clamp(16px,3vw,48px)!important;border-radius:0!important;z-index:110!important;
  display:flex!important;flex-direction:column;overflow:hidden!important;
  background:var(--bg)!important;border:1px solid var(--line-active);
  box-shadow:none;
}
body #plugin-popover[hidden]{display:none!important}
body #plugin-popover .plugin-popover-head{font:600 16px/1.4 var(--sans);letter-spacing:0;padding:0 0 12px;margin:0;flex:none}
body #plugin-popover .plugin-filters{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,180px) minmax(0,180px);gap:10px;margin:14px 0;flex:none}
body #plugin-popover .plugin-filters input{min-width:0}
body #plugin-popover .plugin-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;flex:1;min-height:0;overflow-y:auto!important;overflow-x:hidden;padding:4px;align-content:start;scrollbar-gutter:stable}
body #plugin-popover .plugin-grid.plugin-setup{display:block!important}
body #plugin-popover .plugin-category{min-width:0}
body #plugin-popover .plugin-item{display:grid;grid-template-columns:38px minmax(0,1fr) 84px;padding:12px;gap:12px;min-height:96px;margin:8px 0;transform:none}
body #plugin-popover .plugin-copy small{font-size:12px;overflow-wrap:anywhere}
body #plugin-popover .plugin-state{max-width:none;font-size:11px;white-space:normal}
body #plugin-popover .plugin-status{margin:10px 0 0;font-size:12px;flex:none}
body #plugin-popover .plugin-runner input,body #plugin-popover .plugin-runner select{max-width:100%;box-sizing:border-box}
body #plugin-popover button:focus-visible{outline:2px solid var(--cyan);outline-offset:2px}
.cortex-control{display:block;margin:12px auto;padding:0;width:220px;height:220px;border:0!important;background:transparent!important;border-radius:50%;position:relative}
.cortex-control img{width:100%;height:100%;object-fit:contain;pointer-events:none}
.cortex-companion[data-voice=listening] .cortex-control{animation:cortex-breathe 2.4s ease-in-out infinite;outline:2px solid #00c5da;outline-offset:8px}
.cortex-companion[data-voice=thinking] .cortex-control{animation:cortex-breathe 1.6s ease-in-out infinite;outline:2px dashed #7a89ff;outline-offset:8px}
.cortex-companion[data-voice=speaking] .cortex-control{animation:cortex-breathe 1.2s ease-in-out infinite;outline:2px solid #22bc91;outline-offset:8px}
.cortex-companion:is([data-voice=listening],[data-voice=thinking],[data-voice=speaking])>details{display:none}
.cortex-companion .companion-voice-state{overflow-wrap:anywhere}
.cortex-companion{max-height:90dvh;overflow:auto}
.cortex-companion .dialog-close{position:absolute;top:4px;right:4px}
.cortex-signal{display:flex;align-items:center;gap:12px;padding:10px;border:1px solid var(--cyan);border-radius:12px;margin:10px 0;color:var(--text)}
.cortex-signal img{width:52px!important;height:52px!important;margin:0!important;animation:cortex-breathe 2.4s ease-in-out infinite}
.cortex-signal[data-state=attention]{border-color:var(--amber);background:color-mix(in srgb,var(--amber) 12%,transparent)}
.cortex-signal[data-state=attention] img{animation:none;outline:2px solid var(--amber);border-radius:50%}
.cortex-signal[hidden]{display:none!important}
@keyframes cortex-breathe{0%,100%{opacity:.75;filter:drop-shadow(0 0 3px #00c9e055)}50%{opacity:1;filter:drop-shadow(0 0 16px #00c9e0aa)}}
@media(max-width:700px){body #plugin-popover{inset:0!important;width:100vw!important;padding:12px!important}body #plugin-popover .plugin-filters{grid-template-columns:1fr 1fr}body #plugin-popover .plugin-filters input{grid-column:1/-1}body #plugin-popover .plugin-grid{grid-template-columns:1fr}body #plugin-popover .plugin-item{grid-template-columns:32px minmax(0,1fr) 72px;padding:10px;gap:8px}.cortex-control{width:180px;height:180px}}
@media(prefers-reduced-motion:reduce){.cortex-control,.cortex-signal img{animation:none!important}}
@media(forced-colors:active){.cortex-signal,.cortex-control{outline-color:Highlight!important;border-color:ButtonText}.cortex-companion{background:Canvas!important}}

.cortex-companion:not([data-voice="idle"])[data-voice] .companion-voice-access{display:none}
.companion-voice-access{display:grid;gap:8px;text-align:left;margin:14px 0}
.companion-voice-access input{width:100%;padding:10px;border:1px solid var(--line);border-radius:8px;background:var(--bg);color:var(--text)}

.control-icon{width:18px;height:18px;flex:0 0 18px;display:inline-block;vertical-align:middle;margin-right:8px;pointer-events:none}
.composer-add-menu button{display:flex;align-items:center;gap:10px}.composer-add-menu .control-icon{margin:0;color:var(--accent)}

.live-audio-btn svg{width:22px;height:22px;color:var(--cyan);filter:drop-shadow(0 0 3px color-mix(in srgb,var(--cyan) 35%,transparent))}
.live-audio-btn:hover svg,.live-audio-btn:focus-visible svg{filter:drop-shadow(0 0 5px color-mix(in srgb,var(--cyan) 55%,transparent))}
.cortex-companion[data-voice=listening]{--heartbeat-color:#00eaff}
.cortex-companion[data-voice=thinking]{--heartbeat-color:#9685ff}
.cortex-companion[data-voice=speaking]{--heartbeat-color:#39ffd0}
.cortex-companion:is([data-voice=listening],[data-voice=thinking],[data-voice=speaking]) .cortex-control{animation:cortex-heartbeat 1.65s ease-in-out infinite;box-shadow:0 0 28px var(--heartbeat-color),0 0 75px color-mix(in srgb,var(--heartbeat-color) 65%,transparent);outline:2px solid var(--heartbeat-color)}
@keyframes cortex-heartbeat{0%,45%,100%{transform:scale(1);filter:brightness(1.05) drop-shadow(0 0 12px var(--heartbeat-color))}12%{transform:scale(1.065);filter:brightness(1.35) drop-shadow(0 0 30px var(--heartbeat-color))}24%{transform:scale(1.015)}34%{transform:scale(1.045);filter:brightness(1.25) drop-shadow(0 0 24px var(--heartbeat-color))}}
@media(prefers-reduced-motion:reduce){.cortex-companion .cortex-control{animation:none!important;transform:none!important;filter:drop-shadow(0 0 18px var(--heartbeat-color,#00eaff))}}

.desktop-companion{width:min(440px,calc(100vw - 24px));max-height:88dvh;overflow:auto;border-radius:24px!important;border:1px solid color-mix(in srgb,var(--cyan,#00f2fe) 25%,var(--line,#344857))!important;background:radial-gradient(ellipse at 50% 15%,color-mix(in srgb,var(--cyan,#00f2fe) 10%,transparent),var(--b1x-solid,#0a1520) 70%)!important;box-shadow:0 24px 64px rgba(0,0,0,0.6),0 0 32px rgba(0,242,254,0.12)!important;backdrop-filter:blur(24px)}.desktop-companion label{display:grid;gap:6px;margin:10px 0;font-size:11px;color:var(--muted)}.desktop-companion input,.desktop-companion select,.desktop-companion textarea{width:100%;box-sizing:border-box;border-radius:10px;border:1px solid var(--line);background:rgba(255,255,255,0.03);color:var(--text);font-size:12px}.desktop-companion pre{white-space:pre-wrap;max-height:200px;overflow:auto;font-size:11px;border-radius:10px;background:rgba(0,0,0,0.3);padding:10px}.desktop-companion img{max-width:100%;border-radius:12px}.desktop-actions{display:flex;flex-wrap:wrap;gap:6px}
.desktop-companion-head{display:flex;align-items:center;gap:12px;padding-bottom:12px;border-bottom:1px solid rgba(255,255,255,0.08)}.desktop-companion-head img{width:36px;height:36px;object-fit:contain;border-radius:50%;filter:drop-shadow(0 0 8px rgba(0,242,254,0.5))}.desktop-companion-head div{min-width:0;flex:1}.desktop-companion-head span{color:var(--cyan,#00f2fe);font-size:9.5px;letter-spacing:.14em;font-weight:600}.desktop-companion-head h2{margin:2px 0 0;font-size:16px;font-weight:600}.desktop-companion-head [data-close]{border:0;background:transparent;padding:4px 8px;min-height:28px;color:var(--muted);border-radius:6px;cursor:pointer}.desktop-companion-head [data-close]:hover{color:var(--text);background:rgba(255,255,255,0.06)}
.desktop-companion .desktop-companion-intro{margin:12px 0 8px;font-size:12px;color:var(--text);line-height:1.5}.desktop-companion-links{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:10px 0}.desktop-companion-links a{display:flex;justify-content:space-between;gap:6px;align-items:center;padding:8px 12px;border-radius:10px;background:rgba(255,255,255,0.03);border:1px solid rgba(255,255,255,0.08);color:var(--text);font-size:11px;font-weight:600;text-decoration:none;transition:all 0.15s ease}.desktop-companion-links a:hover,.desktop-companion-links a:focus-visible{background:rgba(0,242,254,0.08);border-color:rgba(0,242,254,0.3);color:var(--cyan,#00f2fe)}.desktop-companion .desktop-companion-note{color:var(--muted);font-size:10.5px;line-height:1.45;margin:8px 0 12px}.desktop-companion-pair{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:8px}.desktop-companion-pair label{margin:0}.desktop-companion-pair input{min-height:34px}.desktop-companion-pair button{min-height:34px;border-radius:10px;font-size:11.5px;font-weight:600}.desktop-companion [data-status]{font-size:11px;color:var(--muted);margin:8px 0 0}
@media(max-width:480px){.desktop-companion-links{grid-template-columns:1fr}.desktop-companion-pair{grid-template-columns:1fr}.desktop-companion-pair button{width:100%}}

.shared-context{width:min(620px,calc(100vw - 32px));max-height:85dvh;overflow:auto;color:var(--text)}
.shared-context header,.shared-context [data-files]>div{display:flex;align-items:center;justify-content:space-between;gap:16px}
.shared-context textarea{display:block;box-sizing:border-box;width:100%;min-height:150px;margin:10px 0;padding:14px;border-radius:14px;background:var(--panel);color:inherit;border:1px solid var(--line)}
.context-open{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:10px;font-size:12px}.context-open svg{width:16px;height:16px}

/* Fixed navigation and filters; the catalogue alone scrolls. */
body #plugin-popover .plugin-popover-head{font-size:20px;text-transform:none;border-bottom:1px solid var(--line);padding-bottom:16px}
body #plugin-popover #plugin-popover-close{width:40px;height:40px;flex:none;border:1px solid var(--line);border-radius:10px}
body #plugin-popover .plugin-category h3{font-size:14px;letter-spacing:0;text-transform:none;margin:12px 0}
body #plugin-popover .plugin-item{border:1px solid var(--line);background:var(--raised);border-radius:12px;text-align:left}
body #plugin-popover .plugin-item:hover{border-color:var(--cyan)}
body #plugin-popover .plugin-filters :is(input,select){min-height:42px}
body #plugin-popover .plugin-setup{max-width:1100px;width:100%;align-self:center}
body #plugin-popover .plugin-status{border-top:1px solid var(--line);padding-top:12px}
@media(min-width:1500px){body #plugin-popover .plugin-grid:not(.plugin-setup){grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:700px){body #plugin-popover{padding:max(12px,env(safe-area-inset-top)) 12px max(12px,env(safe-area-inset-bottom))!important}body #plugin-popover .plugin-popover-head{font-size:17px}}
