.ecca-chat{--ecca-navy:#0a2540;--ecca-accent:#2962ff;font-size:15px;line-height:1.7;color:#1c2833}
.ecca-chat *,.ecca-chat *::before,.ecca-chat *::after{box-sizing:border-box}

/* 浮動ボタン */
.ecca-chat__toggle{position:fixed;right:20px;bottom:20px;z-index:99998;display:flex;align-items:center;gap:8px;
  padding:14px 20px;border:0;border-radius:999px;background:var(--ecca-navy);color:#fff;font-size:15px;font-weight:700;
  box-shadow:0 8px 24px rgba(10,37,64,.3);cursor:pointer}
.ecca-chat__toggle:hover{opacity:.9}
.ecca-chat__toggle svg{width:20px;height:20px;fill:currentColor}

/* パネル */
.ecca-chat__panel{display:flex;flex-direction:column;background:#fff;border:1px solid #d9e2ec;border-radius:14px;overflow:hidden;
  box-shadow:0 24px 60px -20px rgba(10,37,64,.4)}
.ecca-chat--float .ecca-chat__panel{position:fixed;right:20px;bottom:20px;z-index:99999;width:min(400px,calc(100vw - 40px));height:min(620px,calc(100vh - 40px))}
.ecca-chat--inline .ecca-chat__panel{width:100%;max-width:760px;height:560px;margin:0 auto}
.ecca-chat__panel[hidden]{display:none}

.ecca-chat__head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:14px 16px;background:var(--ecca-navy);color:#fff}
.ecca-chat__title{font-weight:700;font-size:15px;margin:0}
.ecca-chat__close{border:0;background:transparent;color:#fff;font-size:22px;line-height:1;cursor:pointer;padding:0 4px}

.ecca-chat__log{flex:1;overflow-y:auto;padding:16px;background:#f6f9fc}
.ecca-msg{margin:0 0 14px;display:flex}
.ecca-msg__bubble{max-width:85%;padding:11px 14px;border-radius:14px;white-space:pre-wrap;word-break:break-word}
.ecca-msg--bot .ecca-msg__bubble{background:#fff;border:1px solid #e2e8f0;border-top-left-radius:4px}
.ecca-msg--me{justify-content:flex-end}
.ecca-msg--me .ecca-msg__bubble{background:var(--ecca-accent);color:#fff;border-top-right-radius:4px}
.ecca-msg--sys .ecca-msg__bubble{background:#fff3cd;border:1px solid #ffe08a;color:#7a5b00;font-size:14px}
.ecca-msg__bubble a{color:inherit;text-decoration:underline}
.ecca-msg--bot .ecca-msg__bubble a{color:var(--ecca-accent)}

.ecca-chat__typing{display:inline-flex;gap:4px;padding:4px 0}
.ecca-chat__typing i{width:7px;height:7px;border-radius:50%;background:#9aa5b1;animation:ecca-blink 1.2s infinite}
.ecca-chat__typing i:nth-child(2){animation-delay:.2s}
.ecca-chat__typing i:nth-child(3){animation-delay:.4s}
@keyframes ecca-blink{0%,80%,100%{opacity:.25}40%{opacity:1}}

.ecca-chat__form{display:flex;gap:8px;padding:12px;border-top:1px solid #e2e8f0;background:#fff}
.ecca-chat__input{flex:1;resize:none;max-height:120px;padding:10px 12px;border:1px solid #c9d4de;border-radius:10px;font:inherit}
.ecca-chat__input:focus{outline:2px solid var(--ecca-accent);outline-offset:1px}
.ecca-chat__send{border:0;border-radius:10px;padding:0 18px;background:var(--ecca-navy);color:#fff;font-weight:700;cursor:pointer}
.ecca-chat__send[disabled]{opacity:.45;cursor:not-allowed}
.ecca-chat__note{padding:0 12px 10px;font-size:11px;color:#8a97a5;background:#fff;text-align:center}
@media(max-width:600px){.ecca-chat--float .ecca-chat__panel{right:0;bottom:0;width:100vw;height:100dvh;border-radius:0}}
