/* Chat presentation is scoped to messaging; note editor styles are unchanged. */
.dn-chat-panel,.dn-chat-dialog,.dn-chat-toast{font-family:system-ui,-apple-system,"Noto Sans KR","Malgun Gothic",sans-serif;color:#20332d;font-size:14px;line-height:1.55;letter-spacing:-.015em}
.dn-chat-panel{--chat-accent:#18745c;--chat-soft:#e5f2eb;--chat-canvas:#f4f7f5;position:fixed;z-index:150;right:24px;bottom:20px;width:min(860px,calc(100vw - 48px));height:min(760px,calc(100dvh - 88px));display:flex;flex-direction:column;background:#fff;border:1px solid #e0e8e2;border-radius:24px;box-shadow:0 24px 80px #20332d26;overflow:hidden}
.dn-chat-panel.automation{--chat-accent:#956522;--chat-soft:#fff1d8;--chat-canvas:#fbf8f1}
.dn-chat-panel[hidden],.dn-chat-panel [hidden],.dn-chat-dialog [hidden],.dn-chat-toggle[hidden]{display:none!important}
.dn-chat-panel button,.dn-chat-dialog button,.dn-chat-panel textarea,.dn-chat-dialog input,.dn-chat-dialog select,.dn-chat-dialog textarea{font:inherit;letter-spacing:inherit}
.dn-chat-panel button,.dn-chat-dialog button{cursor:pointer;transition:background-color .15s,border-color .15s}
.dn-chat-panel button:disabled,.dn-chat-dialog button:disabled{cursor:default;opacity:.46}
.dn-chat-panel :focus-visible,.dn-chat-dialog :focus-visible,.dn-chat-toast:focus-visible{outline:3px solid #18745c55;outline-offset:3px}
.dn-chat-toggle{display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;padding:9px;position:relative;border-radius:13px}
.dn-chat-toggle svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8}
.dn-chat-toggle b{position:absolute;top:-4px;right:-5px;background:#18745c;color:#fff;border-radius:20px;min-width:20px;padding:2px 5px;font:600 10px/16px system-ui}
.dn-chat-head{display:flex;align-items:center;gap:12px;padding:16px;background:#fff;color:#20332d;border-bottom:1px solid #e0e8e2;min-height:78px;box-sizing:border-box;flex:none}
.dn-chat-head>div{flex:1;min-width:0;display:grid;gap:3px}
.dn-chat-head strong{font-size:19px;font-weight:750;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dn-chat-head small{font-size:12px;color:#667a71}
.dn-chat-head button{display:grid;place-items:center;flex:none;width:42px;min-height:42px;padding:8px;border:0;border-radius:14px;background:#f4f7f5;color:var(--chat-accent)}
.dn-chat-head button:hover{background:var(--chat-soft)}
.dn-chat-head button svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.dn-chat-brand,.dn-chat-toast-icon{display:grid;place-items:center;flex:none;width:40px;height:40px;background:var(--chat-soft,#e5f2eb);border-radius:14px;color:var(--chat-accent,#18745c)}
.dn-chat-brand svg{width:25px;height:25px;fill:none;stroke:currentColor;stroke-width:1.7}
.dn-chat-status{font-size:12px;color:#956522;background:#fff1d8;flex:none}
.dn-chat-status:not(:empty){margin:10px 16px 0;padding:12px 14px;border-radius:14px}
.dn-chat-main{display:grid;grid-template-columns:280px minmax(0,1fr);flex:1;min-height:0}
.dn-chat-rooms{--chat-accent:#18745c;--chat-soft:#e5f2eb;display:flex;flex-direction:column;gap:12px;background:#f4f7f5;border-right:1px solid #e0e8e2;min-height:0;padding:16px}
.dn-chat-rooms.automation{--chat-accent:#956522;--chat-soft:#fff1d8}
.dn-chat-tabs{order:0;display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:4px;background:#eaf0ec;border-radius:16px;flex:none}
.dn-chat-tabs button{min-height:44px;padding:10px 5px;border:0;border-radius:12px;background:transparent;color:#667a71;font-size:12px;font-weight:600;line-height:1.45}
.dn-chat-tabs button.selected{background:#fff;color:#18745c;box-shadow:0 2px 6px #20332d09}
.dn-chat-tabs button[data-chat-tab=automation].selected{background:#fff1d8;color:#956522}
.dn-chat-new{order:1;width:100%;min-height:46px;flex:none;padding:11px 14px;background:var(--chat-accent);color:#fff;border:0;border-radius:14px;font-weight:650}
.dn-chat-create-actions{order:1;display:flex;align-items:center;gap:8px;flex:none}
.dn-chat-create-actions .dn-chat-new{order:0;flex:1;width:auto;min-width:0}
.dn-chat-self{flex:none;padding:7px 10px;border:1px solid #c7ded2;border-radius:12px;background:#fff;color:#18745c;font-size:12px!important;font-weight:600;white-space:nowrap}
.dn-chat-self:hover{background:#e5f2eb}
.dn-chat-rooms>[data-chat-people]{order:2;width:100%;min-height:42px;flex:none;padding:9px 14px;background:#fff;color:#18745c;border:1px solid #e0e8e2;border-radius:14px;font-size:13px;font-weight:600}
.dn-chat-room-list{order:3;min-height:0;overflow:auto;padding:2px 0 8px}
.dn-chat-room-list>button{display:flex;align-items:center;gap:10px;width:100%;text-align:left;border:1px solid #e0e8e2;background:#fff;border-radius:18px;margin:0 0 10px;padding:13px 12px;color:#20332d}
.dn-chat-room-list>button:hover{border-color:#b7c9be}
.dn-chat-room-list>button.selected{background:#e5f2eb;border-color:#a4cfbb}
.dn-chat-room-list>button.automation.selected{background:#fff1d8;border-color:#dec18e}
.dn-chat-room-copy{display:grid;gap:6px;flex:1;min-width:0}
.dn-chat-room-line{display:flex;align-items:center;gap:8px;min-width:0}
.dn-chat-room-line strong{flex:1;min-width:0;font-size:14px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dn-chat-room-line time{flex:none;font-size:10px;font-weight:450;color:#667a71;white-space:nowrap}
.dn-chat-room-copy>small{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;color:#667a71;font-size:12px;line-height:1.6;overflow-wrap:anywhere}
.dn-chat-room-list b{flex:none;align-self:flex-end;min-width:19px;padding:3px 6px;border-radius:20px;background:#18745c;color:#fff;font-size:10px;text-align:center}
.dn-chat-room-list .automation b{background:#956522}
.dn-chat-avatar{display:grid;place-items:center;flex:none;width:38px;height:38px;border-radius:13px;background:#e5f2eb;color:#18745c;font-weight:650;font-size:15px}
.dn-chat-room-list>button.automation .dn-chat-avatar,.dn-chat-panel.automation .dn-chat-message>.dn-chat-avatar{background:#fff1d8;color:#956522}
.dn-chat-conversation{display:flex;flex-direction:column;min-height:0;min-width:0;background:var(--chat-canvas)}
.dn-chat-title{padding:15px 18px;background:#fff;border-bottom:1px solid #e0e8e2;font-weight:650;font-size:14px;overflow-wrap:anywhere;flex:none}
.dn-chat-messages{flex:1;min-height:0;overflow:auto;padding:18px;overscroll-behavior:contain}
.dn-chat-day{display:flex;justify-content:center;margin:10px 0 22px;text-align:center}
.dn-chat-day span{padding:6px 13px;border:1px solid #e0e8e2;border-radius:20px;background:#ffffffdf;color:#667a71;font-size:11px}
.dn-chat-message{display:flex;gap:8px;margin:14px 0;align-items:flex-start}
.dn-chat-message>div{max-width:82%;min-width:0}
.dn-chat-message.own{justify-content:flex-end}
.dn-chat-sender{display:block;margin:0 0 5px 2px;font-weight:500;font-size:12px;color:#667a71;overflow-wrap:anywhere}
.dn-chat-bubble{padding:12px 14px;background:#fff;border:1px solid #e0e8e2;border-radius:5px 20px 20px 20px}
.own .dn-chat-bubble{background:#e5f2eb;border-color:#d6e9df;border-radius:20px 5px 20px 20px}
.automation .dn-chat-bubble,.automation .own .dn-chat-bubble{background:#fff1d8;border-color:#f0ddb9}
.dn-chat-bubble p{margin:0;white-space:pre-wrap;overflow-wrap:anywhere;font-size:15px;line-height:1.7}
.dn-chat-bubble.short-sms p{font-size:23px;font-weight:650;letter-spacing:.02em;line-height:1.5}
.dn-chat-route{display:block;margin:6px 2px 0;font-size:11px;line-height:1.6;color:#667a71;overflow-wrap:anywhere}
.dn-chat-time{display:flex;align-items:center;flex-wrap:wrap;gap:7px;margin:5px 2px 0;font-size:11px;color:#667a71}
.own .dn-chat-time{justify-content:flex-end}
.dn-chat-time b{font-weight:500;color:#18745c}
.dn-chat-time span{color:#956522}
.dn-chat-compose{display:flex;align-items:flex-end;gap:8px;padding:12px;background:#fff;border-top:1px solid #e0e8e2;flex:none}
.dn-chat-compose textarea{resize:none;flex:1;min-width:0;min-height:48px;max-height:130px;box-sizing:border-box;border:1px solid #e0e8e2;background:#fff;border-radius:17px;padding:13px 14px;color:#20332d;font-size:14px;line-height:1.6}
.dn-chat-compose textarea::placeholder{color:#667a71}
.dn-chat-compose>button{min-height:48px;background:#18745c;border:0;color:#fff;border-radius:15px;padding:11px 16px;font-weight:650}
.dn-chat-photo-button{display:grid;place-items:center;flex:none;width:40px;min-height:48px;color:#18745c;font-size:27px;cursor:pointer}
.dn-chat-conversation footer{padding:0 12px 10px;text-align:center;background:#fff;font-size:10px;color:#667a71;flex:none}
.dn-chat-older{align-self:center;padding:8px 16px;min-height:36px;margin:12px;border:1px solid #e0e8e2;border-radius:16px;background:#fff;color:#18745c;font-size:12px}
.dn-chat-messages>.dn-chat-older{display:block;margin:0 auto 16px;max-width:100%;}
.dn-chat-latest{align-self:center;flex:none;max-width:calc(100% - 24px);margin:4px 12px 8px;padding:7px 16px;min-height:32px;border:1px solid #d8e5dd;border-radius:16px;background:#f5faf7;color:#18745c;font-size:12px;}
.dn-chat-empty{display:flex;flex-direction:column;align-items:center;gap:10px;padding:30px 12px;text-align:center;color:#667a71;font-size:13px}
.dn-chat-empty-symbol{display:grid;place-items:center;width:64px;height:64px;background:var(--chat-soft,#e5f2eb);border-radius:22px;color:var(--chat-accent,#18745c);margin:6px 0}
.dn-chat-empty-symbol svg{width:30px;height:30px;fill:none;stroke:currentColor;stroke-width:1.5}
.dn-chat-empty strong{font-size:15px;color:#20332d}
.dn-chat-empty p{margin:0;font-size:12px;line-height:1.7}
.dn-chat-photo-draft{padding:9px 16px;font-size:12px;background:#e5f2eb}
.dn-chat-photo-draft button{float:right;border:0;background:transparent;color:#18745c}
.dn-chat-photo{border:0;border-radius:12px;padding:6px;background:#edf5f0;color:#18745c;font-size:12px}
.dn-chat-photo img{display:block;max-width:240px;width:100%;max-height:280px;object-fit:contain;border-radius:10px}
.dn-chat-expired{font-size:12px;color:#667a71}
.dn-chat-panel [data-device-target-box]{padding:8px 16px;background:#fff;font-size:12px}
.dn-chat-panel [data-device-target-box] label{display:flex;align-items:center;gap:10px}
.dn-chat-panel [data-device-target-box] select{flex:1;min-width:0;border:1px solid #e0e8e2;border-radius:12px;background:#fff;color:#20332d;padding:9px;font:inherit}
.dn-chat-toast{position:fixed;z-index:300;right:24px;top:20px;display:flex;align-items:flex-start;gap:8px;width:min(420px,calc(100vw - 32px));box-sizing:border-box;padding:10px 12px;background:#fff;border:1px solid #e0e8e2;border-radius:16px;box-shadow:0 14px 40px #20332d26;text-align:left;color:#20332d;animation:dn-chat-arrive .2s ease-out}
.dn-chat-toast>span:nth-child(2){display:grid;gap:4px;flex:1;min-width:0}
.dn-chat-toast-icon{width:30px;height:30px;border-radius:10px}
.dn-chat-toast-icon img{width:24px;height:24px;object-fit:contain;border-radius:7px}
.dn-chat-toast-meta{display:flex;align-items:center;justify-content:space-between;gap:8px;color:#667a71;font-size:10px}
.dn-chat-toast-meta b{color:#18745c;font-weight:600}
.dn-chat-toast strong{font-size:12px;overflow-wrap:anywhere}
.dn-chat-toast small{font-size:13px;line-height:1.4;color:#20332d;white-space:pre-wrap;overflow-wrap:anywhere;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:6;overflow:hidden}
.dn-chat-toast em{font-size:10px;font-style:normal;color:#956522}
.dn-chat-toast.automation{border-color:#ebd5aa;background:#fffaf1}
.dn-chat-toast.automation .dn-chat-toast-meta b{color:#956522}
.dn-chat-toast.automation .dn-chat-toast-icon{background:#fff1d8}
.dn-chat-dialog{width:min(440px,calc(100vw - 32px));max-height:calc(100dvh - 48px);box-sizing:border-box;overflow:auto;border:1px solid #e0e8e2;border-radius:26px;padding:24px;background:#f8faf8;color:#20332d;box-shadow:0 24px 80px #20332d33}
.dn-chat-dialog::backdrop,.dn-chat-photo-viewer::backdrop{background:#10291f70;backdrop-filter:blur(3px)}
.dn-chat-dialog h2{margin:0 0 20px;font-size:21px;line-height:1.4;font-weight:750}
.dn-chat-dialog h3{margin:22px 0 10px;font-size:15px;font-weight:650}
.dn-chat-dialog p{margin:12px 0;color:#667a71;font-size:13px;line-height:1.75;overflow-wrap:anywhere}
.dn-chat-dialog form{display:grid;gap:14px}
.dn-chat-dialog label{display:flex;flex-wrap:wrap;align-items:center;gap:10px;font-size:13px;font-weight:550}
.dn-chat-dialog>label{display:grid;gap:8px;margin:15px 0}
.dn-chat-dialog input:not([type=checkbox]),.dn-chat-dialog select,.dn-chat-dialog textarea{width:100%;min-width:0;min-height:46px;box-sizing:border-box;padding:12px 13px;border:1px solid #cddbd2;border-radius:14px;background:#fff;color:#20332d;outline-offset:2px}
.dn-chat-dialog input[type=checkbox]{width:20px;height:20px;accent-color:#18745c;flex:none}
.dn-chat-dialog button{min-height:44px;padding:10px 15px;border:1px solid #d4e1d8;border-radius:13px;background:#fff;color:#18745c;font-size:13px;font-weight:600}
.dn-chat-dialog button[type=submit],.dn-chat-dialog [data-request],.dn-chat-dialog [data-create]{background:#18745c;color:#fff;border-color:#18745c}
.dn-chat-dialog [data-create]{background:#956522;border-color:#956522;width:100%;margin:8px 0}
.dn-chat-dialog [data-token]{font-family:ui-monospace,monospace;font-size:18px;line-height:1.8;letter-spacing:.08em;color:#80551d;background:#fff1d8;border-color:#eedbb7;margin-top:10px}
.dn-chat-dialog [data-copy]{width:100%;margin:8px 0}
.dn-chat-dialog form>div{display:flex;gap:8px;justify-content:flex-end}
.dn-chat-dialog [data-people] p{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:14px;border:1px solid #e0e8e2;border-radius:16px;background:#fff;color:#20332d}
.dn-chat-dialog [data-people] button{padding:7px 11px;min-height:38px;font-size:12px}
.dn-chat-dialog [role=status]:not(:empty){padding:12px 14px;border-radius:13px;background:#fff1d8;color:#956522}
.dn-chat-photo-viewer{max-width:90vw;max-height:90dvh;border:0;padding:0;background:transparent;overflow:auto}
.dn-chat-photo-viewer img{display:block;max-width:90vw;max-height:85dvh;object-fit:contain}
.dn-chat-photo-viewer button{position:absolute;right:8px;top:8px;width:44px;height:44px;border:0;border-radius:14px;background:#20332dbb;color:#fff;font-size:24px}
@keyframes dn-chat-arrive{from{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:640px){
 .dn-chat-panel{right:8px;bottom:8px;width:calc(100vw - 16px);height:calc(100dvh - 72px);border-radius:22px}
 .dn-chat-head{padding:12px;gap:10px}.dn-chat-head strong{font-size:18px}.dn-chat-head .dn-chat-brand{display:none}
 .dn-chat-main{display:flex;flex-direction:column}.dn-chat-rooms{flex:1;border-right:0}.dn-chat-conversation{display:none;flex:1}
 .dn-chat-panel.has-room .dn-chat-rooms{display:none}.dn-chat-panel.has-room .dn-chat-conversation{display:flex}
 .dn-chat-room-list>button{padding:14px}.dn-chat-room-line strong{font-size:15px}.dn-chat-room-copy>small{font-size:13px}
 .dn-chat-avatar{width:42px;height:42px}.dn-chat-messages{padding:14px}.dn-chat-message>div{max-width:82%}.dn-chat-message>.dn-chat-avatar{width:32px;height:32px;border-radius:11px;font-size:13px}
 .dn-chat-bubble p{font-size:15px}.dn-chat-compose{gap:6px;padding:10px}.dn-chat-compose>button{padding:11px 13px}
 .dn-chat-toast{right:12px;top:12px;width:calc(100vw - 24px)}.dn-chat-dialog{padding:20px}
}
@media(prefers-reduced-motion:reduce){.dn-chat-toast{animation:none}.dn-chat-panel button,.dn-chat-dialog button{transition:none}}
.dn-chat-loading{display:flex;align-items:center;justify-content:center;gap:9px;padding:12px;color:#36765b;font-size:12px;background:#f3faf6}
.dn-chat-loading[hidden]{display:none}.dn-chat-loading>span{width:17px;height:17px;border:2px solid #cbe5d7;border-top-color:#258760;border-radius:50%;animation:dn-chat-loading-spin .8s linear infinite}
@keyframes dn-chat-loading-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.dn-chat-loading>span{animation:none;border-style:dotted}}
