
:root{
  --acw-accent:#1F5D97;
  --acw-accent-dark:#164a7c;
  --acw-dark:#0A1E30;
  --acw-cream:#F7F8F8;
  --acw-border:#C7D0D9;
  --acw-font:'Pretendard','Inter','Noto Sans KR','Noto Sans',-apple-system,BlinkMacSystemFont,'Apple SD Gothic Neo','Segoe UI',sans-serif;
}


.acw-launcher-wrap{
  position:fixed;
  right:16px;
  bottom:calc(64px + 20px);
  z-index:9600;
  display:flex;
  align-items:center;
  gap:8px;
  font-family:var(--acw-font);
  transition:opacity .25s ease, transform .25s ease;
}
.acw-launcher-wrap.acw-hide{ opacity:0; transform:scale(.92); pointer-events:none; }

@media (max-width:760px){
  .acw-launcher-wrap{
    right:14px;
    /* bottom consult bar is 60px tall on every page; sit 6px above it */
    bottom:calc(60px + env(safe-area-inset-bottom,0px) + 6px);
    gap:0;
  }
  .acw-launcher-wrap .acw-launcher{ width:52px; height:52px; }
  .acw-launcher-wrap .acw-bubble{ display:none !important; }
}

.acw-launcher{
  width:56px;height:56px;border-radius:9999px;border:0;cursor:pointer;
  background:var(--acw-accent);color:#fff;
  display:flex;align-items:center;justify-content:center;
  box-shadow:0 10px 26px rgba(10,30,48,.28), 0 2px 8px rgba(10,30,48,.16);
  transition:transform .18s ease, background .18s ease;
}
.acw-launcher:hover{ transform:scale(1.06); background:var(--acw-accent-dark); }
.acw-launcher:active{ transform:scale(.95); }
.acw-launcher svg{ width:25px;height:25px; }

/* 말풍선 */
.acw-bubble{
  position:relative;
  display:flex;align-items:center;gap:7px;
  background:#fff;border:1px solid var(--acw-border);
  border-radius:9999px;
  padding:9px 8px 9px 13px;
  box-shadow:0 8px 20px rgba(10,30,48,.16);
  overflow:visible;
  animation:none;
}
.acw-bubble__dot{
  width:6px;height:6px;border-radius:9999px;background:#22a06b;flex:0 0 auto;
  animation:acwDot 1.8s ease-in-out 4;
}
.acw-bubble__text{
  font-size:12px;font-weight:600;color:var(--acw-dark);white-space:nowrap;line-height:1;
}
.acw-bubble__close{
  width:20px;height:20px;border-radius:9999px;border:0;background:transparent;
  display:flex;align-items:center;justify-content:center;color:#8a97a3;cursor:pointer;flex:0 0 auto;
}
.acw-bubble__close:hover{ background:var(--acw-cream); color:var(--acw-dark); }
.acw-bubble__tail{
  position:absolute;right:-4px;top:50%;transform:translateY(-50%) rotate(45deg);
  width:8px;height:8px;background:#fff;border-right:1px solid var(--acw-border);border-top:1px solid var(--acw-border);
}
.acw-bubble__sheen{ position:absolute;inset:0;border-radius:9999px;overflow:hidden;pointer-events:none; }
.acw-bubble__sheen::before{
  content:'';position:absolute;top:-20%;bottom:-20%;left:0;width:34%;
  background:linear-gradient(100deg, rgba(31,93,151,0) 0%, rgba(31,93,151,.28) 50%, rgba(31,93,151,0) 100%);
  transform:translateX(-160%) skewX(-18deg);
  animation:acwSheen 2.8s ease-in-out 4;
}
.acw-launcher--halo{ animation:acwHalo 2.8s ease-out 4; }

@keyframes acwSheen{
  0%{ transform:translateX(-160%) skewX(-18deg); opacity:0; }
  35%{ opacity:1; }
  100%{ transform:translateX(320%) skewX(-18deg); opacity:0; }
}
@keyframes acwHalo{
  0%{ box-shadow:0 0 0 0 rgba(31,93,151,.5); }
  70%{ box-shadow:0 0 0 14px rgba(31,93,151,0); }
  100%{ box-shadow:0 0 0 0 rgba(31,93,151,0); }
}
@keyframes acwDot{
  0%,100%{ opacity:1; transform:scale(1); }
  50%{ opacity:.35; transform:scale(.75); }
}
@media (prefers-reduced-motion: reduce){
  .acw-bubble__sheen::before, .acw-bubble__dot, .acw-launcher--halo{ animation:none; }
}

/* ── 채팅 패널 ── */
.acw-panel{
  position:fixed;
  right:16px;
  bottom:calc(64px + 20px + 68px);
  z-index:9700;
  width:376px;
  max-width:calc(100vw - 32px);
  height:min(560px, calc(100vh - 160px));
  background:#fff;
  border-radius:18px;
  box-shadow:0 24px 60px rgba(10,30,48,.28), 0 4px 16px rgba(10,30,48,.14);
  display:flex;flex-direction:column;overflow:hidden;
  font-family:var(--acw-font);
  opacity:0;transform:translateY(16px) scale(.98);pointer-events:none;
  transition:opacity .22s ease, transform .22s ease;
}
.acw-panel.acw-panel--open{ opacity:1; transform:translateY(0) scale(1); pointer-events:auto; }

@media (max-width:760px){
  .acw-panel{
    right:8px;left:8px;width:auto;max-width:none;
    bottom:calc(60px + env(safe-area-inset-bottom,0px) + 10px);
    height:min(72vh, 560px);
  }
}

@media (max-width:1024px){
  .acw-bubble__text{ line-height:1.5; }
  .acw-disclaimer{ font-size:12px; }
}

.acw-panel__head{
  background:var(--acw-dark);color:#fff;
  padding:14px 16px;display:flex;align-items:center;justify-content:space-between;flex:0 0 auto;
}
.acw-panel__head-title{ font-size:14.5px;font-weight:700;letter-spacing:-.01em; }
.acw-panel__head-sub{ font-size:11.5px;color:rgba(255,255,255,.68);margin-top:2px; }
.acw-panel__close{
  width:46px;height:46px;border-radius:9999px;border:0;background:rgba(255,255,255,.12);color:#fff;
  display:flex;align-items:center;justify-content:center;cursor:pointer;flex:0 0 auto;
}
.acw-panel__close:hover{ background:rgba(255,255,255,.22); }

.acw-panel__body{
  flex:1 1 auto;overflow-y:auto;padding:14px 14px 6px;
  display:flex;flex-direction:column;gap:10px;background:var(--acw-cream);
}
.acw-msg{ max-width:84%;font-size:13.5px;line-height:1.55;padding:10px 12px;border-radius:14px;white-space:pre-wrap;word-break:keep-all;overflow-wrap:anywhere; }
.acw-msg--assistant{ align-self:flex-start;background:#fff;border:1px solid var(--acw-border);color:#22303c;border-bottom-left-radius:4px; }
.acw-msg--user{ align-self:flex-end;background:var(--acw-accent);color:#fff;border-bottom-right-radius:4px; }
.acw-msg--pending{ align-self:flex-start;color:#8a97a3;font-size:12.5px; }

.acw-quick{ display:flex;flex-wrap:wrap;gap:6px;padding:2px 14px 10px;flex:0 0 auto; }
.acw-quick__chip{
  border:1px solid var(--acw-border);background:#fff;border-radius:9999px;
  font-size:11.5px;color:var(--acw-dark);padding:6px 11px;cursor:pointer;white-space:nowrap;
  display:flex;align-items:center;justify-content:center;
}
.acw-quick__chip:hover{ border-color:var(--acw-accent);color:var(--acw-accent); }

.acw-panel__foot{
  flex:0 0 auto;border-top:1px solid var(--acw-border);background:#fff;
  padding:10px 12px;display:flex;flex-direction:column;gap:8px;
}
.acw-inputrow{ display:flex;align-items:center;gap:8px; }
.acw-input{
  flex:1 1 auto;border:1px solid var(--acw-border);border-radius:9999px;
  padding:10px 14px;font-size:13.5px;font-family:inherit;color:var(--acw-dark);outline:none;
}
.acw-input:focus{ border-color:var(--acw-accent); }
.acw-send{
  width:46px;height:46px;border-radius:9999px;border:0;background:var(--acw-accent);color:#fff;
  display:flex;align-items:center;justify-content:center;cursor:pointer;flex:0 0 auto;
}
.acw-send:disabled{ background:#b9c3cc;cursor:default; }
.acw-send svg{ width:17px;height:17px; }
.acw-disclaimer{ font-size:10.5px;color:#8a97a3;line-height:1.5; }
.acw-disclaimer a{ color:var(--acw-accent);font-weight:600;text-decoration:none; }

/* tap target 44px min — 46px 로 잡아 닫힌 패널 scale(.98) 축소분(44*.98=43.12px 미달)을 흡수한다 */

.acw-panel__close, .acw-quick__chip, .acw-input, .acw-send{ min-height:46px !important; }

/* ── 떠 있는 상담 버튼이 본문 글자를 덮지 않게 ────────────────
   버튼은 그대로 두고, 넓은 화면에서는 옆에 붙은 안내를 평소에 접어
   버튼 폭만 차지하게 한다. 마우스를 올리거나 초점이 들어오면 펼친다. */
@media (min-width:761px){
  .acw-launcher-wrap{ gap:0; right:12px; }
  .acw-launcher-wrap:hover, .acw-launcher-wrap:focus-within{ gap:8px; }
  .acw-launcher-wrap .acw-bubble{
    max-width:0; padding-left:0; padding-right:0;
    border-left-width:0; border-right-width:0;
    opacity:0; overflow:hidden; pointer-events:none;
    transition:max-width .22s ease, opacity .22s ease, padding .22s ease;
  }
  .acw-launcher-wrap:hover .acw-bubble,
  .acw-launcher-wrap:focus-within .acw-bubble{
    max-width:260px; padding:9px 8px 9px 13px;
    border-left-width:1px; border-right-width:1px;
    opacity:1; pointer-events:auto;
  }
}

/* 좁은 화면 — 버튼을 화면 가장자리로 붙이고 크기를 줄인다.
   손가락으로 누르는 최소 크기는 지킨다. */
@media (max-width:760px){
  .acw-launcher-wrap{ right:8px; }
  /* 지면 셸이 아이디 선택자로 크기를 박아 두어 같은 세기로 맞선다 */
  #acw-root .acw-launcher,
  .acw-launcher-wrap .acw-launcher{ width:46px !important; height:46px !important; }
  #acw-root .acw-launcher svg,
  .acw-launcher-wrap .acw-launcher svg{ width:22px !important; height:22px !important; }
}

/* 손가락이 화면을 미는 동안에는 버튼을 흐리게 둔다 — 멈추면 되돌린다.
   상담 경로는 그대로 두고 밑에 깔린 본문 글자가 읽히게 하는 처리다. */
@media (max-width:768px){
  .acw-launcher-wrap{ transition:opacity .22s ease; }
  body.ce-floatdim .acw-launcher-wrap{ opacity:.26; }
}
