.csw { position: fixed; right: 20px; bottom: 20px; z-index: 9999; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }

.csw-fab {
    width: 56px; height: 56px; border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #38bdf8);
    color: #fff; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; box-shadow: 0 10px 25px rgba(37, 99, 235, .4);
    position: relative; transition: transform .15s;
}
.csw-fab:hover { transform: scale(1.06); }
.csw-badge {
    position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px;
    border-radius: 9px; background: #e5484d; color: #fff; font-size: 11px; line-height: 18px;
    text-align: center; font-weight: 700;
}

.csw-panel {
    position: absolute; right: 0; bottom: 70px; width: min(360px, 92vw); height: min(560px, 80vh);
    background: #fff; border-radius: 16px; display: flex; flex-direction: column; overflow: hidden;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .25); border: 1px solid #e6edf7;
}
.csw-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px; background: linear-gradient(135deg, #2563eb, #38bdf8); color: #fff;
}
.csw-title { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.csw-actions { display: flex; gap: 6px; }
.csw-btn-ghost {
    background: rgba(255,255,255,.18); border: none; color: #fff; cursor: pointer;
    font-size: 12px; padding: 5px 9px; border-radius: 8px; font-family: inherit;
}
.csw-btn-ghost:hover { background: rgba(255,255,255,.3); }

.csw-queue {
    padding: 8px 14px; font-size: 13px; color: #8a5a00; background: #fff7e6; border-bottom: 1px solid #ffe7ba;
}
.csw-queue b { color: #d4380d; font-size: 15px; }
.csw-queue-priority { color: #096dd9; background: #e6f4ff; border-bottom-color: #bae0ff; }

.csw-msgs {
    flex: 1; overflow-y: auto; padding: 14px; background: #f5f8fc;
    display: flex; flex-direction: column; gap: 10px;
}
.csw-tip { color: #9aa7bd; font-size: 13px; text-align: center; margin: auto; }
.csw-row { display: flex; }
.csw-mine { justify-content: flex-end; }
.csw-theirs { justify-content: flex-start; }
.csw-bubble {
    max-width: 78%; padding: 9px 12px; border-radius: 14px; font-size: 14px; line-height: 1.5;
    word-break: break-word; white-space: pre-wrap;
    background: #fff; color: #1f2a44; border: 1px solid #e6edf7;
}
.csw-mine .csw-bubble { background: #2563eb; color: #fff; border-color: #2563eb; border-bottom-right-radius: 4px; }
.csw-theirs .csw-bubble { border-bottom-left-radius: 4px; }
.csw-img { max-width: 180px; max-height: 180px; border-radius: 8px; display: block; }
.csw-sticker { width: 84px; height: 84px; }
.csw-system { justify-content: center; }
.csw-sys {
    max-width: 88%; padding: 6px 10px; border-radius: 10px; font-size: 12px; text-align: center;
    color: #5b7296; background: #eef3fb;
}

.csw-compose { border-top: 1px solid #e6edf7; background: #fff; }
.csw-tools { display: flex; gap: 4px; padding: 6px 10px 0; }
.csw-ico {
    width: 32px; height: 32px; border: none; background: transparent; color: #5b7296; cursor: pointer;
    border-radius: 8px; font-size: 16px;
}
.csw-ico:hover { background: #eef3fb; color: #2563eb; }
.csw-picker {
    display: none; position: absolute; bottom: 56px; right: 20px; width: min(300px, 88vw);
    background: #fff; border: 1px solid #e6edf7; border-radius: 12px; padding: 8px;
    box-shadow: 0 10px 30px rgba(15,23,42,.18); max-height: 180px; overflow-y: auto; z-index: 20;
}
.csw-emoji { display: inline-block; width: 32px; height: 32px; line-height: 32px; text-align: center; cursor: pointer; font-size: 20px; border-radius: 6px; }
.csw-emoji:hover { background: #eef3fb; }
.csw-sticker-opt { width: 48px; height: 48px; cursor: pointer; border-radius: 8px; padding: 3px; }
.csw-sticker-opt:hover { background: #eef3fb; }
.csw-inputrow { display: flex; gap: 8px; padding: 8px 10px 10px; align-items: flex-end; }
.csw-inputrow textarea {
    flex: 1; resize: none; border: 1px solid #dbe4f0; border-radius: 10px; padding: 9px 10px;
    font-size: 14px; font-family: inherit; max-height: 96px; outline: none; color: #1f2a44;
}
.csw-inputrow textarea:focus { border-color: #2563eb; }
.csw-send {
    border: none; background: #2563eb; color: #fff; border-radius: 10px; padding: 9px 16px;
    font-size: 14px; cursor: pointer; font-family: inherit; white-space: nowrap;
}
.csw-send:hover { background: #1d4ed8; }
.csw-send:disabled { opacity: .6; cursor: default; }

.csw-toast {
    position: fixed; left: 50%; top: 20%; transform: translateX(-50%);
    background: rgba(15,23,42,.9); color: #fff; padding: 10px 16px; border-radius: 10px;
    font-size: 14px; z-index: 10000; font-family: inherit;
}

@media (max-width: 480px) {
    .csw-panel { right: 8px; bottom: 76px; width: 94vw; }
    .csw-picker { right: 8px; }
}
