/* 상담 챗봇 위젯 + 구글 프로필 무료 진단 버튼 (site/assets/chat.js 가 그린다).
   회사 홈페이지(www.o2osolution.ai) 위젯과 같은 모양·크기다(AIO2O_AEO_Site src/components/ChatWidget.astro).
   이 사이트는 보라 포인트 컬러를 #613CFF 하나만 쓰므로, 회사 홈페이지의 짙은 보라(#4F1DA1) 자리는 #613CFF 로 바꿨다.
   업종 카드 전체 화면(.stage.full, z-index 50)이 열리면 그 아래로 가려지게 z-index 40 으로 둔다. */
.cw{position:fixed;right:1.4rem;bottom:1.4rem;z-index:40;display:flex;flex-direction:column;align-items:flex-end;gap:10px;font-family:var(--sans);line-height:1.4;
  /* 무료 진단 버튼·추천 질문 말풍선은 같은 크기·같은 알약 모양. 에이전트 버튼만 따로 둔다 */
  --cw-chip-w:300px;--cw-chip-h:52px;--cw-chip-r:999px;
  --cw-chip-shadow:0 0 0 1px rgba(97,60,255,.18),0 10px 26px -8px rgba(11,17,32,.35),0 3px 8px rgba(11,17,32,.12);
  --cw-head:linear-gradient(to right,#613CFF,#021341);
  --cw-elevate:0 0 0 1px rgba(11,17,32,.06),0 20px 25px -5px rgba(11,17,32,.1),0 8px 10px -6px rgba(11,17,32,.08)}
.cw [hidden]{display:none!important}
.cw button{font-family:var(--sans)}

/* 에이전트 버튼: 짙은 바탕 + #613CFF 빛 구슬 + 이름 */
.cw-launch{border:0;cursor:pointer;color:#fff;display:inline-flex;align-items:center;gap:12px;text-align:left;
  background:radial-gradient(120% 140% at 0% 50%,rgba(97,60,255,.45) 0%,rgba(97,60,255,0) 55%),#0B1120;
  border-radius:999px;padding:9px 20px 9px 9px;
  box-shadow:0 0 0 1px rgba(97,60,255,.35),0 10px 28px -6px rgba(97,60,255,.55),0 4px 10px rgba(11,17,32,.25);
  transition:transform .2s ease,box-shadow .2s ease}
.cw-launch:hover{transform:translateY(-2px);box-shadow:0 0 0 1px rgba(97,60,255,.6),0 14px 34px -6px rgba(97,60,255,.75),0 4px 10px rgba(11,17,32,.25)}
.cw-launch:hover .cw-orb>span::before{animation-duration:1.6s}
.cw-launch:focus-visible,.cw-fab:focus-visible,.cw-bubble:focus-visible{outline:2px solid #613CFF;outline-offset:3px}
.cw-launch-txt{display:flex;flex-direction:column;line-height:1.2}
.cw-launch-txt b{font-size:15px;font-weight:700;letter-spacing:-.01em}
.cw-launch-txt small{font-size:12.5px;color:#B9B0FF;margin-top:2px}

/* 구슬. iOS(WebKit)는 회전 요소에 filter·mix-blend-mode 가 걸리면 둥근 잘라내기를 무시하므로 쓰지 않는다 */
.cw-orb{position:relative;flex:none;width:34px;height:34px;border-radius:50%;
  background:radial-gradient(circle at 32% 28%,#FFFFFF 0 6%,#CFF8F0 15%,#8B6BFF 38%,#613CFF 58%,#2A0F8A 82%,#140647 100%);
  box-shadow:-3px -4px 14px rgba(62,242,200,.55),3px 4px 16px rgba(97,60,255,.7),inset 0 -3px 8px rgba(10,4,40,.5);
  animation:cw-breathe 3.2s ease-in-out infinite}
.cw-orb>span{position:absolute;inset:0;border-radius:50%;overflow:hidden;clip-path:circle(50% at 50% 50%);
  -webkit-mask-image:radial-gradient(circle,#000 70%,transparent 71%);mask-image:radial-gradient(circle,#000 70%,transparent 71%);transform:translateZ(0)}
.cw-orb>span::before{content:'';position:absolute;inset:-25%;border-radius:50%;
  background:
    radial-gradient(circle at 28% 30%,rgba(62,242,200,.95) 0%,rgba(62,242,200,.45) 22%,rgba(62,242,200,0) 46%),
    radial-gradient(circle at 74% 70%,rgba(150,120,255,.75) 0%,rgba(150,120,255,0) 45%),
    radial-gradient(circle at 70% 24%,rgba(255,255,255,.55) 0%,rgba(255,255,255,0) 30%),
    radial-gradient(circle at 30% 78%,rgba(110,255,220,.5) 0%,rgba(110,255,220,0) 38%);
  animation:cw-spin 4.5s linear infinite}
.cw-orb-sm{width:30px;height:30px}
.cw-thinking .cw-orb>span::before{animation-duration:1s}
.cw-thinking .cw-orb{animation-duration:1.1s}
@keyframes cw-spin{to{transform:rotate(360deg)}}
@keyframes cw-breathe{0%,100%{transform:scale(1)}50%{transform:scale(1.07)}}

/* 추천 질문 말풍선 */
.cw-nudge{display:flex;flex-direction:column;align-items:flex-end;gap:8px;position:relative}
.cw-bubble{border:0;cursor:pointer;background:#fff;color:var(--ink);box-sizing:border-box;width:var(--cw-chip-w);min-height:var(--cw-chip-h);border-radius:var(--cw-chip-r);padding:6px 22px;display:flex;align-items:center;font-size:14.5px;font-weight:500;line-height:1.35;text-align:left;word-break:keep-all;box-shadow:var(--cw-chip-shadow)}
.cw-nudge-x{position:absolute;top:-12px;right:-6px;width:24px;height:24px;border:0;border-radius:50%;background:#fff;color:var(--muted);cursor:pointer;font-size:15px;line-height:1;box-shadow:0 1px 4px rgba(11,17,32,.18)}

/* 구글 프로필 무료 진단 버튼: 말풍선과 같은 크기·알약 모양, 인디고 그라데이션(회사 홈페이지와 같은 값) */
.cw-fab{display:inline-flex;align-items:center;gap:12px;color:#fff;background:linear-gradient(100deg,#27237A 0%,#4338CA 55%,#5B6CF0 100%);box-sizing:border-box;width:var(--cw-chip-w);min-height:var(--cw-chip-h);border-radius:var(--cw-chip-r);padding:0 22px 0 9px;
  box-shadow:0 0 0 1px rgba(255,255,255,.14) inset,0 10px 26px -8px rgba(67,56,202,.55),0 3px 8px rgba(11,17,32,.16);transition:transform .2s ease,box-shadow .2s ease,filter .2s ease}
.cw-fab:hover{transform:translateY(-2px);color:#fff;filter:brightness(1.06);box-shadow:0 0 0 1px rgba(255,255,255,.2) inset,0 14px 32px -8px rgba(67,56,202,.7),0 3px 8px rgba(11,17,32,.18)}
.cw-fab-ic{flex:none;width:34px;height:34px;border-radius:50%;background:#fff;display:grid;place-items:center}
.cw-fab-ic svg{width:20px;height:20px;fill:none;stroke:#4338CA;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.cw-fab-txt{display:flex;flex-direction:column;line-height:1.2;text-align:left}
.cw-fab-txt b{font-size:15px;font-weight:700;letter-spacing:-.01em}
.cw-fab-txt small{font-size:12.5px;color:#C7CCFF;margin-top:2px}

/* 대화 창 */
.cw-panel{width:380px;max-height:min(640px,calc(100vh - 100px));display:flex;flex-direction:column;background:#fff;border-radius:20px;overflow:hidden;box-shadow:var(--cw-elevate)}
.cw-head{display:flex;justify-content:space-between;align-items:center;gap:10px;background:var(--cw-head);color:#fff;padding:14px 16px 14px 18px}
.cw-head-id{display:flex;align-items:center;gap:10px;min-width:0}
.cw-head strong{display:block;font-size:16px}
.cw-head span{display:block;font-size:12.5px;color:#C9CFF5}
.cw-head-actions{display:flex;align-items:center;gap:6px}
.cw-lead-btn{border:0;cursor:pointer;background:#fff;color:#021341;border-radius:999px;padding:6px 12px;font-size:13px;font-weight:700;line-height:1.2;white-space:nowrap}
.cw-close{border:0;cursor:pointer;background:transparent;color:#fff;font-size:22px;line-height:1;padding:2px 6px}
.cw-body{flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:10px;background:#FAFBFE}
.cw-notice{margin:0;font-size:12px;color:var(--muted);text-align:center;line-height:1.5}
.cw-notice a{color:var(--muted);text-decoration:underline}
.cw-msg{max-width:88%;padding:10px 13px;border-radius:14px;font-size:15px;line-height:1.6;white-space:pre-wrap;word-break:keep-all;overflow-wrap:anywhere;margin:0}
.cw-bot{background:#fff;color:var(--ink-2);box-shadow:0 1px 2px rgba(11,17,32,.08),0 4px 10px -4px rgba(11,17,32,.08)}
.cw-user{align-self:flex-end;background:#613CFF;color:#fff}
.cw-wait{color:var(--muted)}
.cw-src{display:block;margin-top:6px;font-size:13px;color:var(--muted);white-space:normal}
.cw-src a{color:#613CFF;margin-right:8px;text-decoration:underline}
.cw-quick{display:flex;flex-direction:column;align-items:flex-start;gap:6px}
.cw-quick button{border:0;cursor:pointer;background:#fff;color:var(--ink);text-align:left;border-radius:12px;padding:8px 12px;font-size:14px;font-weight:500;line-height:1.45;box-shadow:0 1px 2px rgba(11,17,32,.08),0 4px 10px -4px rgba(11,17,32,.12)}
.cw-input{display:flex;gap:8px;padding:12px;border-top:1px solid var(--line);background:#fff}
.cw-input input{flex:1;width:auto;min-width:0;border:0;background:#F1F3F9;border-radius:999px;padding:10px 14px;font:400 15px/1.3 var(--sans);color:var(--ink)}
.cw-input input:focus,.cw-input input:focus-visible{outline:1px solid #613CFF;outline-offset:0;border-radius:999px}
.cw-send{border:0;cursor:pointer;color:#fff;background:linear-gradient(to right,#613CFF,#021341);border-radius:999px;padding:0 16px;font-size:14px;font-weight:700;line-height:1}
.cw-send:disabled,.cw-lead-send:disabled{opacity:.55;cursor:default}

/* 상담 요청 카드 */
.cw-lead{background:#fff;border-radius:14px;padding:14px;display:flex;flex-direction:column;gap:7px;box-shadow:0 1px 2px rgba(11,17,32,.08),0 8px 18px -8px rgba(11,17,32,.2)}
.cw-lead strong{font-size:15px}
.cw-lead-sub,.cw-lead-note{margin:0;font-size:12.5px;color:var(--muted);line-height:1.5}
/* 사이트 문의 폼의 전역 label·input 규칙(style.css)을 위젯 안에서는 끊는다 */
.cw-lead input[type="text"]{width:100%;border:0;background:#F1F3F9;border-radius:10px;padding:9px 11px;font:400 14.5px/1.3 var(--sans);color:var(--ink)}
.cw-lead input[type="text"]:focus{outline:1px solid #613CFF;outline-offset:0}
.cw-consent{display:flex;gap:6px;align-items:flex-start;font-size:12.5px;font-weight:400;color:var(--ink-2);line-height:1.45}
.cw-consent input{width:auto;flex:none;margin:2px 0 0;padding:0}
.cw-lead-err{margin:0;font-size:13px;color:#B42318}
.cw-lead-err a{text-decoration:underline}
.cw-lead-send{border:0;cursor:pointer;color:#fff;background:var(--cw-head);border-radius:999px;padding:10px;font-size:14.5px;font-weight:700;line-height:1;text-align:center}
.cw-lead-alt{display:flex;gap:8px;flex-wrap:wrap}
.cw-lead-alt a{display:block;flex:1;min-width:120px;box-sizing:border-box}
.cw-lead-alt a.cw-lead-mail{background:#F1F3F9;color:var(--ink)}
.cw-hp{position:absolute;left:-9999px;width:1px;height:1px;opacity:0}
.cw-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

@media (prefers-reduced-motion:reduce){.cw-orb,.cw-orb>span::before{animation:none}.cw-launch,.cw-fab{transition:none}}
@media (max-width:640px){
  .cw{right:16px;bottom:16px;--cw-chip-w:248px;--cw-chip-h:44px}
  /* 모바일: 무료 진단 버튼은 한 줄(이름만) */
  .cw-fab{padding:0 16px 0 7px;gap:8px}
  .cw-fab-ic{width:30px;height:30px}
  .cw-fab-ic svg{width:17px;height:17px}
  .cw-fab-txt small{display:none}
  .cw-fab-txt b{font-size:14.5px}
  .cw-panel{position:fixed;inset:0;width:auto;max-height:none;border-radius:0}
  .cw-bubble{padding:4px 18px;font-size:13.5px}
}
