.ai-evaluation-launcher {
    position: fixed;
    right: 16px;
    bottom: 64px;
    z-index: 10020;
    display: flex;
    width: auto;
    min-width: 112px;
    height: 48px;
    align-items: center;
    justify-content: center;
    padding: 0 21px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 999px;
    background: #356fca;
    color: #ffffff;
    box-shadow: 0 10px 26px rgba(18, 51, 96, 0.28);
    cursor: pointer;
    transition: background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.ai-launcher-label {
    color: currentColor;
    font: 700 14px/1 Arial, sans-serif;
    letter-spacing: 0;
    white-space: nowrap;
}

.ai-launcher-label-mobile {
    display: none;
}

.ai-evaluation-launcher:hover {
    background: #285da9;
    box-shadow: 0 12px 30px rgba(18, 51, 96, 0.34);
    transform: translateY(-2px);
}

.ai-evaluation-launcher:focus-visible {
    outline: 3px solid rgba(53, 111, 202, 0.34);
    outline-offset: 3px;
}

.ai-evaluation-launcher svg {
    width: 27px;
    height: 27px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ai-evaluation-launcher .icon-close {
    display: none;
}

.ai-evaluation-launcher[aria-expanded="true"] {
    width: 56px;
    min-width: 56px;
    height: 56px;
    padding: 0;
    border-radius: 50%;
}

.ai-evaluation-launcher[aria-expanded="true"] .ai-launcher-label {
    display: none;
}

.ai-evaluation-launcher[aria-expanded="true"] .icon-close {
    display: block;
}

.ai-evaluation-panel {
    position: fixed;
    right: 16px;
    bottom: 132px;
    z-index: 10019;
    width: min(var(--ai-panel-width, 470px), calc(100vw - 32px));
    height: min(var(--ai-panel-height, 760px), calc(100dvh - 160px));
    min-width: 360px;
    min-height: 420px;
    overflow: hidden;
    scrollbar-width: none;
    border: 1px solid #d7dee9;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 24px 64px rgba(18, 35, 58, 0.24);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(12px) scale(0.985);
    transform-origin: bottom right;
    transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
}

.ai-evaluation-panel::-webkit-scrollbar {
    display: none;
}

.ai-evaluation-panel.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.ai-panel-resize-shield {
    position: fixed;
    z-index: 10030;
    inset: 0;
    background: transparent;
    touch-action: none;
}

.ai-panel-resize-shield[hidden] {
    display: none;
}

.ai-panel-resize-handle {
    position: absolute;
    z-index: 5;
    touch-action: none;
    opacity: 0;
    transition: opacity 120ms ease;
}

.ai-panel-resize-handle:hover,
.ai-evaluation-panel.is-resizing .ai-panel-resize-handle {
    opacity: 1;
}

.ai-panel-resize-left {
    top: 18px;
    bottom: 18px;
    left: 0;
    width: 10px;
    cursor: ew-resize;
}

.ai-panel-resize-left::after {
    position: absolute;
    top: 32px;
    bottom: 32px;
    left: 3px;
    width: 2px;
    border-radius: 2px;
    background: rgba(53, 111, 202, 0.62);
    content: "";
}

.ai-panel-resize-top {
    top: 0;
    right: 18px;
    left: 18px;
    height: 10px;
    cursor: ns-resize;
}

.ai-panel-resize-top::after {
    position: absolute;
    top: 3px;
    right: 32px;
    left: 32px;
    height: 2px;
    border-radius: 2px;
    background: rgba(53, 111, 202, 0.62);
    content: "";
}

.ai-panel-resize-corner {
    top: 0;
    left: 0;
    width: 18px;
    height: 18px;
    cursor: nwse-resize;
}

.ai-panel-resize-corner::after {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 8px;
    height: 8px;
    border-top: 2px solid rgba(53, 111, 202, 0.68);
    border-left: 2px solid rgba(53, 111, 202, 0.68);
    border-radius: 2px 0 0;
    content: "";
}

.ai-evaluation-panel.is-resizing iframe {
    pointer-events: none;
}

html.ai-panel-resizing,
html.ai-panel-resizing * {
    cursor: var(--ai-panel-resize-cursor) !important;
    user-select: none !important;
}

.ai-panel-control {
    position: absolute;
    top: 10px;
    z-index: 3;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    padding: 0;
    border: 1px solid #d7dee9;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.96);
    color: #344054;
    box-shadow: 0 4px 12px rgba(18, 35, 58, 0.14);
    cursor: pointer;
}

.ai-panel-close {
    right: 10px;
    font: 400 25px/1 Arial, sans-serif;
}

.ai-panel-refresh {
    right: 52px;
    font: 400 23px/1 Arial, sans-serif;
}

.ai-panel-refresh span {
    display: block;
}

.ai-panel-control:hover {
    background: #f2f5f9;
    color: #172033;
}

.ai-panel-control:focus-visible {
    outline: 3px solid rgba(53, 111, 202, 0.34);
    outline-offset: 2px;
}

.ai-panel-refresh.is-loading span {
    animation: ai-panel-refresh-spin 700ms linear infinite;
}

@keyframes ai-panel-refresh-spin {
    to {
        transform: rotate(360deg);
    }
}

.ai-evaluation-panel iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% + 42px);
    border: 0;
    background: #ffffff;
    display: block;
    overflow: hidden;
    scrollbar-width: none;
}

.ai-evaluation-panel iframe::-webkit-scrollbar {
    display: none;
}

.ai-panel-loading {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: grid;
    place-items: center;
    padding: 20px;
    background: #ffffff;
    color: #667085;
    font-family: Arial, sans-serif;
    font-size: 13px;
    text-align: center;
}

.ai-panel-loading[hidden] {
    display: none;
}

@media (max-width: 768px), (hover: none) and (pointer: coarse) and (max-width: 1024px) {
    .ai-evaluation-launcher {
        right: 12px;
        bottom: 62px;
        width: 52px;
        min-width: 52px;
        height: 52px;
        padding: 0;
        border-radius: 50%;
    }

    body.agent-home-active .ai-evaluation-launcher[aria-expanded="false"] {
        right: max(6px, env(safe-area-inset-right));
        bottom: max(10px, env(safe-area-inset-bottom));
    }

    .ai-launcher-label-desktop {
        display: none;
    }

    .ai-launcher-label-mobile {
        display: block;
    }

    .ai-evaluation-panel {
        top: max(8px, env(safe-area-inset-top));
        right: max(8px, env(safe-area-inset-right));
        bottom: max(126px, calc(118px + env(safe-area-inset-bottom)));
        left: max(8px, env(safe-area-inset-left));
        width: auto;
        height: auto;
        max-width: none;
        max-height: none;
        min-width: 0;
        min-height: 0;
        border-radius: 14px;
    }

    .ai-panel-resize-handle {
        display: none;
    }

    .ai-panel-control {
        top: 8px;
        width: 32px;
        height: 32px;
    }

    .ai-panel-close {
        right: 8px;
    }

    .ai-panel-refresh {
        right: 48px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ai-evaluation-launcher,
    .ai-evaluation-panel {
        transition: none;
    }

    .ai-panel-refresh.is-loading span {
        animation: none;
    }
}
