.ai-operator-launcher {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1200;
    display: grid;
    width: 58px;
    height: 58px;
    padding: 0;
    place-items: center;
    border: 1px solid #2f80ed;
    border-radius: 50%;
    background: #2f80ed;
    box-shadow: 0 10px 24px rgba(28, 89, 166, 0.28);
    color: #fff;
    font-weight: 700;
    letter-spacing: 0;
    cursor: pointer;
    touch-action: none;
    user-select: none;
}

.ai-operator-launcher[hidden] {
    display: none;
}

.ai-operator-launcher:hover {
    background: #1668c8;
}

.ai-operator-launcher:focus-visible,
.ai-operator-close:focus-visible {
    outline: 3px solid rgba(47, 128, 237, 0.35);
    outline-offset: 3px;
}

.ai-operator-launcher-label {
    font-size: 17px;
    line-height: 1;
}

.ai-operator-launcher-status {
    position: absolute;
    right: 4px;
    bottom: 5px;
    width: 11px;
    height: 11px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #9aa7b5;
}

.ai-operator-launcher.is-running .ai-operator-launcher-status {
    background: #35b36f;
}

.ai-operator-panel {
    position: fixed;
    z-index: 1190;
    display: flex;
    flex-direction: column;
    width: min(340px, calc(100vw - 36px));
    height: calc(100vh - 122px);
    max-height: calc(100vh - 122px);
    overflow: hidden;
    border: 1px solid #d7e2ef;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(32, 59, 94, 0.18);
    color: #243447;
}

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

.ai-operator-head,
.ai-operator-queue-head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-operator-head {
    flex: 0 0 auto;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #e7edf4;
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.ai-operator-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
}

.ai-operator-title-mark {
    display: inline-grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 50%;
    background: #eaf4ff;
    color: #1559a6;
    font-size: 11px;
    font-weight: 700;
}

.ai-operator-close {
    width: 30px;
    height: 30px;
    border: 0;
    background: transparent;
    color: #607086;
    cursor: pointer;
    font-size: 20px;
    touch-action: manipulation;
}

.ai-operator-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    padding: 14px 16px 16px;
}

.ai-operator-runtime-row,
.ai-operator-log-filter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
}

.ai-operator-runtime-row {
    min-height: 38px;
    border-bottom: 1px solid #e7edf4;
    color: #34475d;
    font-size: 13px;
}

.ai-operator-runtime-switch {
    align-items: center;
    margin: 0;
}

.ai-operator-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.ai-operator-summary > div {
    min-width: 0;
    padding: 9px 6px;
    border: 1px solid #e0e8f1;
    border-radius: 5px;
    background: #f8fafc;
    text-align: center;
}

.ai-operator-summary strong,
.ai-operator-summary span {
    display: block;
}

.ai-operator-summary strong {
    color: #1f5f9f;
    font-size: 18px;
}

.ai-operator-summary span {
    margin-top: 2px;
    color: #6a788a;
    font-size: 11px;
}

.ai-operator-log-filter select {
    flex: 1;
    min-width: 0;
    height: 34px;
    border: 1px solid #ccd8e6;
    border-radius: 4px;
    background: #fff;
    padding: 0 8px;
}

.ai-operator-status {
    padding: 10px 12px;
    border-left: 3px solid #2f80ed;
    background: #f3f8ff;
}

.ai-operator-status strong,
.ai-operator-status span {
    display: block;
}

.ai-operator-status span {
    margin-top: 4px;
    color: #607086;
    font-size: 12px;
}

.ai-operator-switch {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0 0 12px;
    color: #44566c;
    font-size: 12px;
    cursor: pointer;
}

.ai-operator-switch input {
    margin-top: 2px;
}

.ai-operator-btn {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid #ccd8e6;
    border-radius: 5px;
    background: #fff;
    color: #34475d;
    cursor: pointer;
}

.ai-operator-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.ai-operator-queue {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    margin-top: 14px;
    border-top: 1px solid #e7edf4;
    padding-top: 12px;
}

.ai-operator-queue-head {
    flex: 0 0 auto;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: 600;
}

#aiOperatorQueueList {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 4px;
    scrollbar-gutter: stable;
}

.ai-operator-queue-count {
    color: #607086;
    font-size: 12px;
    font-weight: 400;
}

.ai-operator-queue-item {
    padding: 9px 10px;
    border-left: 3px solid #b9c6d6;
    background: #f7f9fc;
}

.ai-operator-queue-item + .ai-operator-queue-item {
    margin-top: 7px;
}

.ai-operator-queue-item.status-running,
.ai-operator-queue-item.status-queued {
    border-left-color: #2f80ed;
    background: #f3f8ff;
}

.ai-operator-queue-item.status-completed {
    border-left-color: #31a66a;
}

.ai-operator-queue-item.status-failed {
    border-left-color: #d64d4d;
    background: #fff6f6;
}

.ai-operator-queue-item.status-uncertain {
    border-left-color: #d97706;
    background: #fff9ed;
}

.ai-operator-queue-item.status-stopped {
    border-left-color: #9aa7b5;
}

.ai-operator-queue-name,
.ai-operator-queue-message {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ai-operator-queue-result {
    margin-top: 4px;
    color: #44566c;
    font-size: 11px;
    line-height: 1.4;
}

.ai-operator-queue-message {
    margin-top: 3px;
    color: #607086;
    font-size: 12px;
}

@media (max-width: 640px) {
    .ai-operator-launcher {
        width: 54px;
        height: 54px;
    }

    .ai-operator-panel {
        width: calc(100vw - 20px);
        height: calc(100vh - 106px);
        max-height: calc(100vh - 106px);
    }
}
