.ai-dock { position: static; }
.ai-dock-fab,
.ai-dock-win {
    pointer-events: auto;
    position: fixed;
    z-index: 1080;
}
.ai-dock-fab {
    right: 22px; bottom: 22px;
    width: 52px; height: 52px; border-radius: 50%;
    border: 0; cursor: grab;
    color: #fff; background: linear-gradient(135deg, #1677ff, #0b3a6e);
    box-shadow: 0 10px 24px rgba(22, 119, 255, .38);
    font-size: 22px;
    display: flex; align-items: center; justify-content: center;
    touch-action: none;
}
.ai-dock-fab .ai-spark-svg { width: 28px; height: 28px; color: #fff; display: block; }
.ai-dock-title .ai-spark-svg { width: 16px; height: 16px; color: #fff; }
.ai-dock-fab.is-dragging { cursor: grabbing; }
.ai-dock.open .ai-dock-fab { display: none; }
.ai-dock-win {
    width: 400px; height: 560px;
    min-width: 320px; min-height: 360px;
    max-width: calc(100vw - 16px); max-height: calc(100vh - 16px);
    display: flex; flex-direction: column;
    background: var(--surface-strong, #fff);
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, .22);
    overflow: hidden;
}
.ai-dock-win[hidden] { display: none !important; }
.ai-dock-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; padding: 10px 12px;
    background: #001529; color: #fff; cursor: grab;
    user-select: none;
    touch-action: none;
}
.ai-dock-head.is-dragging { cursor: grabbing; }
.ai-dock-grip { font-size: 16px; opacity: .75; margin-right: 2px; }
.ai-dock-title { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px; pointer-events: none; }
.ai-dock-actions { display: flex; gap: 2px; }
.ai-dock-ico {
    width: 28px; height: 28px; border: 0; border-radius: 6px;
    background: transparent; color: #fff; cursor: pointer;
}
.ai-dock-ico:hover { background: rgba(255,255,255,.12); }
.ai-dock-auth {
    padding: 8px 12px; font-size: 12px;
    background: #fff7e6; color: #ad6800; border-bottom: 1px solid #ffe7ba;
}
.ai-dock-msgs {
    flex: 1; min-height: 0; overflow: auto;
    padding: 12px; background: var(--surface-muted, #f8fbff);
}
.ai-d-msg { display: flex; gap: 8px; margin-bottom: 12px; }
.ai-d-msg.user { flex-direction: row-reverse; }
.ai-d-av {
    width: 28px; height: 28px; border-radius: 8px; flex: none;
    display: flex; align-items: center; justify-content: center;
    background: #1677ff; color: #fff; font-size: 13px;
}
.ai-d-av .ai-spark-svg { color: #fff; }
.ai-d-msg.user .ai-d-av { background: #64748b; }
.ai-d-bubble {
    max-width: 86%;
    background: var(--surface-strong, #fff);
    border: 1px solid var(--border-soft);
    border-radius: 12px; padding: 8px 10px;
    font-size: 13px; line-height: 1.65; color: var(--gray-800, #1f2a37);
    word-break: break-word;
}
.ai-d-msg.user .ai-d-bubble { background: #1677ff; color: #fff; border-color: #1677ff; }
.ai-d-bubble strong { font-weight: 700; }
.ai-d-bubble code {
    font-size: 12px; background: rgba(15,23,42,.06); padding: 0 4px; border-radius: 4px;
}
.ai-d-msg.user .ai-d-bubble code { background: rgba(255,255,255,.18); color: #fff; }
.ai-d-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ai-d-chip {
    border: 1px solid var(--border-soft); background: var(--surface-strong, #fff);
    border-radius: 99px; padding: 3px 10px; font-size: 12px; cursor: pointer; color: var(--gray-700);
}
.ai-d-chip:hover { border-color: #1677ff; color: #1677ff; }
.ai-d-acts { display: flex; gap: 6px; margin-top: 8px; }
.ai-dock-input {
    display: flex; gap: 8px; align-items: flex-end;
    padding: 10px; border-top: 1px solid var(--border-soft);
    background: var(--surface-strong, #fff);
}
.ai-dock-input textarea {
    flex: 1; resize: none; min-height: 38px; max-height: 96px;
    border: 1px solid var(--border-soft); border-radius: 10px;
    padding: 8px 10px; font-size: 13px; background: var(--surface-muted, #f8fbff);
    color: var(--gray-900);
}
.ai-dock-input textarea:focus { outline: none; border-color: #1677ff; }
.ai-dock-send {
    width: 38px; height: 38px; border: 0; border-radius: 10px;
    background: #1677ff; color: #fff; cursor: pointer;
}
.ai-dock-send:disabled { opacity: .45; cursor: not-allowed; }
.ai-dock-resize {
    position: absolute; right: 4px; bottom: 4px;
    width: 16px; height: 16px; cursor: nwse-resize;
    background: linear-gradient(135deg, transparent 50%, #94a3b8 50%);
    border-radius: 2px; opacity: .7;
    touch-action: none;
}
.ai-dock.min .ai-dock-msgs,
.ai-dock.min .ai-dock-input,
.ai-dock.min .ai-dock-auth,
.ai-dock.min .ai-dock-resize { display: none; }
.ai-dock.min .ai-dock-win { height: auto !important; min-height: 0; }
.ai-think { color: var(--gray-500); font-size: 12px; }
.ai-think span {
    display: inline-block; width: 5px; height: 5px; margin-right: 3px;
    border-radius: 50%; background: #1677ff; animation: ai-blink 1s infinite ease-in-out;
}
.ai-think span:nth-child(2) { animation-delay: .15s; }
.ai-think span:nth-child(3) { animation-delay: .3s; }
@keyframes ai-blink { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }
@media (max-width: 640px) {
    .ai-dock-win { width: calc(100vw - 16px) !important; }
}
