:root{color-scheme:dark;font-family:system-ui,-apple-system,"Segoe UI",sans-serif;color:#edf3f8;background:#0c1520;font-synthesis:none}
*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden}button,textarea,a{-webkit-tap-highlight-color:transparent}button,textarea{font:inherit}button,a{touch-action:manipulation}button{cursor:pointer}button:disabled{cursor:default}button:focus-visible,a:focus-visible,textarea:focus-visible,.chat-stream:focus-visible{outline:2px solid #79e8ed;outline-offset:3px}[hidden]{display:none!important}
body{position:fixed;inset:0;overscroll-behavior:none}
.chat-app{grid-template-columns:minmax(0,1fr)}.chat-app>*,.chat-conversation,.chat-stream,.chat-composer{min-width:0}
.chat-app{position:fixed;top:var(--chat-offset-top,0px);left:var(--chat-offset-left,0px);width:min(var(--chat-width,100vw),960px);height:var(--chat-height,100dvh);margin:0;display:grid;grid-template-rows:auto auto auto minmax(0,1fr) auto;background:#111d2a;border-inline:1px solid #24374a;overflow:hidden}
.chat-header{display:flex;align-items:center;gap:12px;padding:13px 18px;background:#152536;border-bottom:1px solid #2b4155}

.chat-title{min-width:0;flex:1}.chat-title h1{margin:0;font-size:20px;line-height:1.35;letter-spacing:-.4px}.chat-title h1 span{font-size:19px;margin-right:3px}.chat-title p{margin:4px 0 0;color:#a8bbce;font-size:12px;line-height:1.4}
.chat-connection{display:flex;align-items:center;gap:6px;flex:none;color:#a9bed0;font-size:11px;white-space:nowrap}.chat-connection i{width:7px;height:7px;border-radius:50%;background:#849bb0}.chat-connection[data-state=connected]{color:#80e7d6}.chat-connection[data-state=connected] i{background:#62ddbd;box-shadow:0 0 8px #62ddbd44}.chat-connection[data-state=disconnected]{color:#f2bb8f}.chat-connection[data-state=disconnected] i{background:#f2bb8f}
.chat-identity{padding:11px 20px 12px;border-bottom:1px solid #22374a;background:#122232}.chat-identity>div{display:flex;align-items:center;flex-wrap:wrap;gap:5px 8px;min-height:21px}.chat-identity-label{font-size:11px;color:#a5b9cb}.chat-identity strong{color:#70e5e4;font-size:14px;line-height:1.45;overflow-wrap:anywhere}.chat-identity p{margin:4px 0 0;color:#7e99b0;font-size:11px;line-height:1.4}.chat-online{margin-left:auto;font-size:11px;color:#a5b9cb;white-space:nowrap}
.chat-conversation{position:relative;min-height:0}.chat-stream{height:100%;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#38546e transparent;padding:18px 20px 22px;overflow-anchor:none}.chat-messages{display:flex;flex-direction:column;gap:17px;min-width:0}
.chat-empty{height:100%;min-height:180px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;color:#8ea9be;padding:28px 12px}.chat-empty>span{font-size:34px;margin-bottom:15px;filter:saturate(.65)}.chat-empty strong{font-size:15px;font-weight:600;color:#bed0df}.chat-empty p{max-width:280px;line-height:1.65;font-size:12px;margin:8px 0 0}
.chat-message{display:flex;align-items:flex-start;gap:9px;min-width:0;max-width:100%}.chat-avatar{display:grid;place-items:center;flex:none;width:31px;height:31px;margin-top:2px;border:1px solid #415b75;border-radius:11px;background:#263c54;color:#c5dced;font-size:13px;font-weight:700}.chat-avatar[data-tone="1"]{background:#3a3152;border-color:#5d4e79;color:#dfcff3}.chat-avatar[data-tone="2"]{background:#224447;border-color:#3b666b;color:#b7e6df}.chat-avatar[data-tone="3"]{background:#443947;border-color:#695169;color:#edd1dd}.chat-avatar[data-tone="4"]{background:#3c412f;border-color:#596649;color:#dce5bc}
.chat-message-content{min-width:0;max-width:min(78%,640px)}.chat-message-head{display:flex;align-items:baseline;gap:8px;margin:0 0 5px;padding:0 2px;min-width:0}.chat-message-name{font-size:12px;font-weight:600;line-height:1.4;color:#c2d3e2;overflow-wrap:anywhere}.chat-message time{font-size:10px;color:#819ab0;white-space:nowrap;flex:none}.chat-bubble{padding:10px 13px;border:1px solid #314c64;border-radius:3px 14px 14px;background:#1d3247;color:#f0f5fa;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.6;font-size:14px}
.chat-message[data-own=true]{justify-content:flex-end}.chat-message[data-own=true] .chat-avatar{display:none}.chat-message[data-own=true] .chat-message-head{justify-content:flex-end}.chat-message[data-own=true] .chat-message-name{color:#77dfdf}.chat-message[data-own=true] .chat-bubble{background:#124b56;border-color:#236b73;border-radius:14px 3px 14px 14px;color:#efffff}.chat-own-label{margin-left:4px;font-size:10px;color:#83b8bf;font-weight:400}
.chat-message-name{min-width:0}.chat-reply-button{display:inline-flex;align-items:center;justify-content:center;flex:none;width:28px;min-height:28px;padding:5px;border:0;border-radius:6px;background:transparent;color:#86a5ba}.chat-reply-button svg{display:block;width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}.chat-reply-button:hover{background:#254257;color:#efffff}.chat-message-head{align-items:center}
.chat-message-reply{display:block;box-sizing:border-box;width:100%;min-width:0;max-width:100%;margin:0 0 8px;padding:0 0 8px 8px;border:0;border-bottom:1px solid #53748966;border-left:2px solid #72cdd4;background:transparent;color:#b9cfdf;text-align:left;font-size:12px;line-height:1.45;white-space:normal;overflow-wrap:anywhere}.chat-message-reply-name{display:block;margin-bottom:2px;color:#8ce3e5;font-size:11px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-message-reply-text{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.chat-message-reply:disabled{opacity:1;cursor:default}
.chat-reply-preview{display:flex;align-items:center;gap:9px;min-width:0;margin:0 0 8px;padding:7px 9px;border-left:3px solid #70d9df;border-radius:5px;background:#0e2233}.chat-reply-preview-content{display:flex;flex:1;flex-direction:column;gap:2px;min-width:0}.chat-reply-preview-content strong{font-size:11px;color:#82e0e4;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-reply-preview-content span{font-size:12px;line-height:17px;color:#b7cbdc;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-reply-preview>button{flex:none;min-width:40px;min-height:32px;padding:5px 7px;border:1px solid #426079;border-radius:6px;background:#1c3449;color:#cee0ed;font-size:11px}
.chat-jump{position:absolute;right:19px;bottom:13px;padding:8px 13px;border:1px solid #397386;border-radius:999px;background:#173f51;color:#c8f8fa;font-size:12px;box-shadow:0 4px 16px #0005;z-index:1}
.chat-composer{padding:10px 18px max(10px,env(safe-area-inset-bottom));border-top:1px solid #2a4055;background:#152536}.chat-notice{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:0;color:#f1c08b;font-size:12px;line-height:1.5}.chat-notice:not(:empty){margin-bottom:7px}.chat-notice:has(#chatNoticeText:empty):has(#chatRetry[hidden]){display:none}.chat-notice button{flex:none;padding:4px 9px;border:1px solid #667584;border-radius:6px;background:#253b50;color:#e5f1fa;font-size:11px}
.chat-input-row{display:flex;align-items:flex-end;gap:9px}.chat-input-row textarea{min-width:0;flex:1;resize:none;min-height:44px;max-height:132px;border:1px solid #3a566f;border-radius:13px;background:#0e1d2c;color:#edf6fd;padding:11px 13px;font-size:16px;line-height:22px;overflow:auto;scrollbar-width:thin}.chat-input-row textarea::placeholder{color:#7995ad}.chat-input-row textarea:disabled{opacity:.65}.chat-input-row>button{display:flex;align-items:center;justify-content:center;gap:4px;flex:none;min-width:67px;min-height:44px;padding:10px 12px;border:1px solid #58d3d7;border-radius:12px;background:#3dd0d5;color:#09252e;font-size:14px;font-weight:750;white-space:nowrap}.chat-input-row>button span{font-size:20px;line-height:1}.chat-input-row>button:disabled{border-color:#395064;background:#293f52;color:#7f9aaf}.chat-input-meta{display:flex;justify-content:space-between;gap:8px;margin:6px 2px 0;font-size:10px;line-height:1.4;color:#7893aa}.chat-input-meta span:last-child{font-variant-numeric:tabular-nums;white-space:nowrap}.chat-input-meta .is-limit{color:#f2c28d}
.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.chat-input-row>.chat-deck-share{min-width:64px;padding-inline:9px;font-size:12px;background:#203d50;border-color:#44687a;color:#c0edef}
.chat-app[data-keyboard=open] .chat-composer{padding-bottom:6px}
@media(min-width:700px){.chat-header{padding-inline:27px}.chat-identity{padding-inline:29px}.chat-stream{padding:24px 29px 26px}.chat-composer{padding-inline:27px}.chat-message-content{max-width:74%}}
@media(max-width:360px){.chat-header{padding-inline:12px;gap:9px}.chat-title h1{font-size:18px}.chat-title p{font-size:11px}.chat-identity{padding-inline:14px}.chat-stream{padding-inline:12px}.chat-composer{padding-inline:12px}.chat-message-content{max-width:80%}.chat-input-row{gap:7px}.chat-input-row>button{min-width:59px;padding-inline:9px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}
/* 대화 공간을 확보하고 입력에는 메시지와 전송만 남깁니다. */
.chat-header{gap:8px;padding:6px 10px}.chat-title h1{font-size:18px;line-height:24px}.chat-header .chat-deck-share{flex:none;min-height:34px;padding:7px 12px;border:1px solid #f0ca4e;border-radius:8px;background:#ffe077;color:#302509;font:750 14px/18px system-ui;white-space:nowrap;box-shadow:inset 0 1px 0 #fff4,0 2px 7px #0003}.chat-header .chat-deck-share:hover{background:#ffe994}.chat-header .chat-deck-share:active{background:#f8d260}.chat-header .chat-deck-share:disabled{opacity:.65}.chat-connection{font-size:9px;gap:4px}.chat-connection i{width:6px;height:6px}.chat-identity{padding:4px 10px 5px}.chat-identity>div{flex-wrap:nowrap;gap:8px;min-height:18px}.chat-identity-name{display:flex;align-items:center;gap:5px;flex:1;min-width:0}.chat-identity strong{font-size:12px;line-height:18px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.chat-identity-label{font-size:10px;flex:none}#chatIdentitySource{font-size:9px;line-height:16px;white-space:nowrap;color:#8faabd;flex:none}.chat-presence{display:flex;align-items:center;gap:7px;flex:none;white-space:nowrap}.chat-presence .chat-online{margin-left:0;font-size:9px;white-space:nowrap;flex:none}.chat-identity p{margin:3px 0 0;font-size:10px}.chat-input-row>button{min-width:50px;padding-inline:11px}.chat-input-row>button span{display:none}
