#gemini-agent-wrapper { position: fixed; bottom: 20px; right: 20px; z-index: 2147483647; /* Nuclear Option: Max 32bit Int */ font-family: inherit; width: 0; height: 0; overflow: visible; }
#gemini-agent-trigger { position: absolute; bottom: 0; right: 0; cursor: pointer; transition: transform 0.2s; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; width: auto; height: auto; }
#gemini-agent-trigger:hover { transform: scale(1.05); }
.gemini-trigger-inner { background: var(--agent-color); color: var(--agent-text); box-shadow: 0 4px 12px rgba(0,0,0,0.25); display: flex; align-items: center; justify-content: center; }
.gemini-mode-circle .gemini-trigger-inner { width: 60px; height: 60px; border-radius: 50%; }
.gemini-mode-pill .gemini-trigger-inner, .gemini-mode-proactive_pill .gemini-trigger-inner { height: 50px; border-radius: 25px; padding: 10px 13px; gap: 12px; white-space: nowrap; }
.gemini-pill-text { font-weight: normal; font-size: 1rem; letter-spacing: 0.5px; padding-top: 1px; }
.gemini-icon-circle { background: white; border-radius: 50%; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
#gemini-agent-close-wrapper { width: 32px; height: 32px; }
#gemini-agent-close { background: none; border: none; color: #888; font-size: 32px; width: 100%; height: 100%; cursor: pointer; padding: 0 0 4px 1px; 
    opacity: 1; display: flex; align-items: center; justify-content: center; line-height: 1; margin: 0; }
#gemini-agent-close:hover { opacity: 0.7; }
@media (max-width: 480px) { #gemini-agent-window { z-index: 2147483647 !important; } } /* MOBILE OVERRIDE */
.gemini-speech-bubble { background: white; color: #333; padding: 12px 24px 12px 16px; border-radius: 12px; font-size: 0.9rem; font-weight: 500; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.5); width: 250px; margin-bottom: 5px; position: relative; animation: gemini-fade-in 0.5s ease-out; }
.gemini-speech-bubble:after { content: ''; position: absolute; bottom: -6px; right: 25px; width: 12px; height: 12px; background: white; transform: rotate(45deg); }
.gemini-bubble-close { position: absolute; top: 2px; right: 5px; font-size: 14px; color: #999; cursor: pointer; line-height: 1; padding: 2px; z-index: 10; }
.gemini-bubble-close:hover { color: #333; }
@keyframes gemini-fade-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
#gemini-agent-window { position: absolute; bottom: 63px; right: 0; background: rgba(255, 255, 255, 0.05); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
    border: 2px solid rgba(176, 255, 214, 0.8); border-top-color: rgba(176, 255, 214, 1); border-left-color: rgba(176, 255, 214, 1); border-radius: 20px; 
    box-shadow: 0 20px 30px rgba(0,0,0,0.5), inset 0 0 0 3px rgba(255,255,255,0.25); display: flex; flex-direction: column; overflow: hidden;
    width: 380px; height: 580px; max-width: calc(100vw - 40px); max-height: calc(100vh - 100px); }
#gemini-agent-header { padding: 15px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(176, 255, 214, 0.3); 
    background: rgba(255,255,255,0.02); position: relative; min-height: 60px; }
.gemini-branding { position: absolute; left: 50%; transform: translateX(-50%); color: white; font-weight: normal; font-size: 0.95rem; 
    text-transform: uppercase; text-shadow: 0 1px 2px rgba(0,0,0,0.7); pointer-events: none; letter-spacing: 1px; }
#gemini-agent-messages { flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.gemini-msg { max-width: 85%; padding: 10px 14px; border-radius: 18px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.gemini-msg a, .gemini-msg ul a, .gemini-msg p a { text-decoration: underline; }
.gemini-msg p, .gemini-msg ul, .gemini-msg p strong, .gemini-msg p b, .gemini-msg a, .gemini-msg-content, .gemini-msg-content p { font-size: 0.95rem; line-height: 1.5; }
.gemini-msg-model, .gemini-msg-model p, .gemini-msg-model ul, .gemini-msg-model ul strong, .gemini-msg-model p strong, .gemini-msg-model p b, .gemini-msg-model a 
    { align-self: flex-start; background: color-mix(in srgb, var(--agent-color), white 20%); color: var(--agent-text); border-bottom-left-radius: 4px; }
.gemini-msg-user, .gemini-msg-user p { align-self: flex-end; background: color-mix(in srgb, var(--agent-color), white 85%); color: #111; border-bottom-right-radius: 4px; }
.gemini-msg-system, .gemini-msg-handover { align-self: center; max-width: 90%; background: rgba(255, 255, 255, 0.9); color: #6c757d; font-size: 0.8rem; 
    padding: 6px 12px; border-radius: 12px; margin-bottom: 8px; box-shadow: none; border: 1px solid rgba(0,0,0,0.05); text-align: center; }
.gemini-msg-system .gemini-msg-content, .gemini-msg-handover .gemini-msg-content { font-size: 0.8rem; }
.gemini-msg-handover { background: #000; color: #fff; }
.gemini-msg-content p { margin-bottom: 8px; }
.gemini-msg-content p:last-child { margin-bottom: 0; }
#gemini-agent-footer { padding: 15px; border-top: 1px solid rgba(176, 255, 214, 0.3); background: rgba(255,255,255,0.05); }
#gemini-agent-form { display: flex; gap: 10px; align-items: flex-end; }
#gemini-agent-input { flex: 1; border-radius: 20px; padding: 12px 15px; resize: none; min-height: 50px; max-height: 120px; outline: none; font-size: 0.95rem;
    font-family: inherit; background: white; color: #000; border: 2px solid rgba(129, 237, 181, 1); box-shadow: inset 0 3px 3px rgba(0,0,0,0.4); }
#gemini-agent-input::placeholder { color: #888; opacity: 1; }
#gemini-agent-send { background: var(--agent-color); border: none; color: var(--agent-text); width: 45px; height: 45px; border-radius: 50%; cursor: pointer; appearance: none; -webkit-appearance: none; 
    margin: 0; padding: 0 0 0 5px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 4px 8px rgba(0,0,0,0.2); transition: transform 0.1s; }
#gemini-agent-send:hover { transform: scale(1.05); }
@media (max-width: 480px) {
    #gemini-agent-window { 
        position: fixed !important; top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
        width: 100vw !important; height: 100dvh !important; /* Use dvh for viewport height logic */ max-width: none !important; max-height: none !important;
        border-radius: 0 !important; border: none !important;
        margin: 0 !important;
        z-index: 10001; /* Above trigger */
        background: rgba(240, 248, 255, 0.95); /* Fallback for mobile performance */
        backdrop-filter: blur(10px);
    }
    #gemini-agent-header {
        padding-top: max(15px, env(safe-area-inset-top)); /* Notch support */
    }
}