#pet-chat-launcher{position:absolute;right:16px;bottom:190px;width:44px;height:44px;border-radius:12px;background:var(--hud-surface);z-index:4}
#pet-chat-launcher svg{width:23px;height:23px;stroke:currentColor;fill:none;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}.chat-unread{position:absolute;top:-5px;right:-3px;width:9px;height:9px;border-radius:50%;background:#9b4b37;font-size:0}
body[data-petting=true] #pet-chat-launcher{display:none}
#pet-chat-dialog{position:fixed;inset:auto 20px 90px auto;margin:0;padding:0;width:370px;max-width:calc(100vw - 24px);height:min(620px,calc(100dvh - 125px));max-height:calc(100dvh - 24px);border:0;border-radius:16px;color:var(--ink);background:#dbe6f5;box-shadow:var(--shadow);overflow:hidden}
#pet-chat-dialog[open]{display:flex;flex-direction:column}#pet-chat-dialog::backdrop{background:#2f3d7a2b}
.pet-chat-header{display:flex;align-items:center;gap:10px;padding:14px 12px;background:var(--paper);flex-shrink:0}.pet-chat-header>img{width:44px;height:44px;object-fit:cover;border-radius:14px}.pet-chat-header>div{min-width:0;flex:1}.pet-chat-header h2{font-family:var(--ui-font),sans-serif;font-weight:400;font-size:20px;margin:0;overflow-wrap:anywhere}.pet-chat-header p{font-size:11px;color:var(--muted);margin:3px 0 0}.pet-chat-header button{width:40px;height:44px;background:transparent}.pet-chat-header svg,#pet-chat-send svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
#pet-chat-settings{padding:12px 16px;background:var(--paper);max-height:45%;overflow:auto;flex-shrink:0;border-top:1px solid var(--edge)}#pet-chat-settings label{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px;font-weight:600}#pet-chat-settings select{padding:9px 6px;border:1px solid var(--edge);border-radius:8px;max-width:190px;background:#fff;color:var(--ink)}#pet-chat-settings p{font-size:12px;line-height:1.7;color:var(--muted);margin:12px 0 0}
#pet-chat-history{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:4px 14px 16px;scrollbar-color:#b9c2e6 #dbe6f5}
.pet-chat-day{text-align:center;color:#4d5a85;font-size:11px;margin:18px 0}.pet-chat-row{display:flex;gap:8px;margin:14px 0;align-items:flex-start}.pet-chat-row>img{width:34px;height:34px;border-radius:11px;object-fit:cover;flex-shrink:0}.pet-chat-content{max-width:calc(100% - 46px);min-width:0}.pet-chat-sender{display:block;font-size:12px;font-weight:600;margin:0 0 6px;overflow-wrap:anywhere}.pet-chat-bubble{padding:11px 13px;background:#f6f4fc;border-radius:2px 14px 14px;margin:0;font-size:14px;line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere}.pet-chat-content time{display:block;font-size:10px;color:#4d5a85;margin-top:5px}.pet-chat-row.guardian{justify-content:flex-end}.guardian .pet-chat-bubble{background:#ffd9c2;border-radius:14px 2px 14px 14px}.guardian time{text-align:right}
#pet-chat-empty{font-size:13px;line-height:1.9;text-align:center;color:#4d5a85;margin:40px 12px}#pet-chat-older{display:block;margin:12px auto;padding:10px 14px;border-radius:8px;background:#e6eaf8;font-size:12px;color:var(--ink)}
#pet-chat-status{margin:0;padding:0 14px;background:var(--paper);font-size:12px;line-height:1.6;overflow-wrap:anywhere;flex-shrink:0}#pet-chat-status:not(:empty){padding-top:9px}
#pet-chat-form{display:flex;align-items:flex-end;gap:8px;padding:12px;background:var(--paper);flex-shrink:0}#pet-chat-reply{resize:none;min-width:0;flex:1;max-height:100px;border:1px solid var(--edge);border-radius:10px;padding:10px;font-size:14px;line-height:1.5;color:var(--ink);background:#fff}#pet-chat-send{width:44px;height:44px;background:var(--green);color:#fff;border-radius:10px;display:grid;place-items:center;flex-shrink:0}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:600px){#pet-chat-dialog{inset:auto 12px max(74px,env(safe-area-inset-bottom)) 12px;width:auto;height:min(610px,calc(100dvh - 100px))}#pet-chat-reply{font-size:16px}#pet-chat-launcher{right:14px;bottom:190px}}
@media(max-height:500px){#pet-chat-dialog{inset:8px 12px;height:calc(100dvh - 16px);max-height:none}.pet-chat-header{padding:6px 10px}#pet-chat-form{padding:6px 10px}}
#pet-chat-ai-note{margin:0;padding:8px 14px;background:#ffd9c2;font-size:12px;line-height:1.6;color:#2f3d7a;flex-shrink:0;overflow-wrap:anywhere}.pet-chat-ai{display:inline-block;margin-top:6px;padding:2px 9px;border-radius:999px;background:#ffd9c2;color:#2f3d7a;font-size:11px;line-height:1.6}

/* AI 답장 해외 전송 동의 확인창과 설정 스위치 */
#pet-chat-consent{padding:14px 16px;background:#e6eaf8;border-top:1px solid var(--edge);min-height:0;overflow:auto;flex:0 1 auto;overflow-wrap:anywhere;color:var(--ink)}
/* 동의창이 떠 있을 때는 대화 기록 영역을 줄여 입력창이 잘리지 않게 한다 */
#pet-chat-dialog.consenting #pet-chat-ai-note{display:none}
#pet-chat-dialog.consenting #pet-chat-history{flex:0 1 56px}
#pet-chat-consent[hidden]{display:none}
#pet-chat-consent h3{margin:0 0 6px;font-size:15px;line-height:1.4}
#pet-chat-consent p{margin:0 0 12px;font-size:12.5px;line-height:1.75}
#pet-chat-consent .consent-actions{display:grid;gap:8px}
body #pet-chat-dialog #pet-chat-consent button{min-height:44px;width:100%;padding:8px 12px;border-radius:10px;font-size:13px;line-height:1.4}
body #pet-chat-dialog #pet-chat-consent-yes{background:#2f3d7a!important;color:#f8f6fd!important;border-color:transparent}
body #pet-chat-dialog #pet-chat-consent-no{background:transparent!important;color:var(--ink)!important;border:1px solid #b9c2e6}
#pet-chat-settings label.pet-chat-consent-row{align-items:flex-start;margin-top:12px;padding-top:12px;border-top:1px solid var(--edge)}
#pet-chat-settings label.pet-chat-consent-row[hidden]{display:none}
.pet-chat-consent-row>span{display:grid;gap:4px;min-width:0}.pet-chat-consent-row small{font-size:11px;line-height:1.6;font-weight:400;color:var(--muted)}
.pet-chat-consent-row input{appearance:none;-webkit-appearance:none;position:relative;width:46px;height:28px;border-radius:99px;background:#9aa69b;transition:background .2s;cursor:pointer;border:0}
.pet-chat-consent-row input::after{content:"";position:absolute;top:3px;left:3px;width:22px;height:22px;border-radius:50%;background:#fff;transition:transform .2s}
.pet-chat-consent-row input:checked{background:#2f3d7a}.pet-chat-consent-row input:checked::after{transform:translateX(18px)}
.pet-chat-consent-row input:focus-visible{outline:3px solid #5b4b8a;outline-offset:2px}.pet-chat-consent-row input:disabled{opacity:.6;cursor:wait}
.pet-chat-consent-row input{flex-shrink:0;margin:0}
@media(max-height:500px){#pet-chat-dialog.consenting #pet-chat-history{flex-basis:0}}
