.ai-floating-launcher {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1200;
    width: 54px;
    height: 54px;
    border: 1px solid var(--border, #2a2a2a);
    border-radius: 50%;
    background: var(--bg-card, #161616);
    color: var(--text-secondary, #777777);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: border-color 150ms ease, color 150ms ease, background-color 150ms ease, transform 150ms ease;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.ai-floating-launcher:hover {
    border-color: var(--accent-blue, #4a9eff);
    color: var(--accent-blue, #4a9eff);
    background: var(--bg-card-hover, #1e1e1e);
    transform: translateY(-1px);
}

.ai-floating-panel {
    position: fixed;
    right: 18px;
    bottom: 84px;
    z-index: 1200;
    width: clamp(360px, 28vw, 460px);
    max-width: calc(100vw - 24px);
    min-height: clamp(420px, 56vh, 620px);
    max-height: min(80vh, 760px);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border, #2a2a2a);
    border-radius: 8px;
    background: var(--bg-card, #161616);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.34);
}

.ai-floating-panel.open {
    display: flex;
}

.ai-floating-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.55rem;
    border-bottom: 1px solid var(--border-subtle, #1f1f1f);
    background: var(--bg-surface, #111111);
}

.ai-floating-live-zone {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-top: auto;
    padding: 0.2rem 0 0.1rem;
    background: linear-gradient(to top, rgba(12, 12, 12, 0.98) 68%, rgba(12, 12, 12, 0) 100%);
}

.ai-floating-title {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 0.66rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary, #777777);
}

.ai-floating-beta {
    border: 1px solid var(--border, #2a2a2a);
    border-radius: 999px;
    padding: 0.08rem 0.35rem;
    font-size: 0.56rem;
    letter-spacing: 0.06em;
    color: var(--text-muted, #444444);
    background: var(--bg-elevated, #1a1a1a);
}

.ai-floating-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
}

.ai-floating-tenant {
    max-width: 108px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: 1px solid var(--border, #2a2a2a);
    border-radius: 999px;
    padding: 0.14rem 0.42rem;
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 0.58rem;
    color: var(--text-muted, #444444);
    background: var(--bg-elevated, #1a1a1a);
}

.ai-floating-link,
.ai-floating-close {
    border: 1px solid var(--border, #2a2a2a);
    background: var(--bg-elevated, #1a1a1a);
    color: var(--text-secondary, #777777);
    border-radius: 6px;
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 0.6rem;
    line-height: 1;
    padding: 0.34rem 0.48rem;
    transition: border-color 150ms ease, color 150ms ease, background-color 150ms ease;
}

.ai-floating-link:hover,
.ai-floating-close:hover {
    border-color: var(--accent-blue, #4a9eff);
    color: var(--accent-blue, #4a9eff);
    background: var(--bg-card-hover, #1e1e1e);
}

.ai-floating-close {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

@media (max-width: 900px) {
    .ai-floating-launcher {
        right: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom));
        width: 52px;
        height: 52px;
    }

    .ai-floating-panel {
        inset: 8px 8px calc(8px + env(safe-area-inset-bottom)) 8px;
        width: auto;
        max-width: none;
        min-height: 0;
        max-height: none;
        border-radius: 8px;
    }

    .ai-floating-header {
        padding: 0.5rem;
        gap: 0.35rem;
    }

    .ai-floating-actions {
        gap: 0.2rem;
    }

    .ai-floating-tenant {
        display: none;
    }

    .ai-floating-link,
    .ai-floating-close {
        min-height: 30px;
        font-size: 0.58rem;
        padding: 0.28rem 0.4rem;
    }
}
