/* 2026-11-16 UX 묶음(web/ux-pack.js와 짝). 색은 모두 사이트 색 변수(--text·--panel·--soft·--line·--danger 등)를 써서
   라이트·다크와 회사 색을 그대로 따른다. 참고 자료(lucian-uxui-prompt, MIT)의 색은 가져오지 않았다. */

/* ---- 부드러운 효과(html.ux-motion일 때만) ---- */
@keyframes ux-rise{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@keyframes ux-pop{from{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:none}}
@keyframes ux-fade{from{opacity:0}to{opacity:1}}
@keyframes ux-shimmer{0%{background-position:-200% 0}100%{background-position:200% 0}}
@keyframes ux-spin{to{transform:rotate(360deg)}}
@keyframes ux-shake{0%,100%{transform:none}20%{transform:translateX(-5px)}40%{transform:translateX(5px)}60%{transform:translateX(-3px)}80%{transform:translateX(3px)}}

html.ux-motion #content.ux-enter>*{animation:ux-rise .22s cubic-bezier(.2,.7,.2,1) both}
html.ux-motion button:not(:disabled),html.ux-motion a.button{transition:background-color .15s ease,border-color .15s ease,color .15s ease,box-shadow .15s ease,transform .08s ease}
html.ux-motion button:not(:disabled):active,html.ux-motion a.button:active{transform:scale(.97)}
html.ux-motion dialog[open]{animation:ux-pop .18s cubic-bezier(.2,.7,.2,1)}
html.ux-motion dialog[open]::backdrop{animation:ux-fade .18s ease}
html.ux-motion dialog.ux-palette.closing{animation:ux-fade .14s ease reverse}
html.ux-motion :is(input,select,textarea){transition:border-color .15s ease,box-shadow .15s ease}
html.ux-motion .ui-status-tag,html.ux-motion .nav-count{transition:background-color .2s ease,color .2s ease}
/* 앱(iOS·Android)은 손가락 누름 느낌을 조금 더 */
html.ux-motion.native-app button:not(:disabled):active{transform:scale(.95)}

/* ---- 검색 중 ---- */
.ux-loading{display:grid;gap:8px;padding:6px 0}
.ux-loading-label{display:flex;align-items:center;gap:8px;margin:0;color:var(--muted);font-size:13px}
.ux-spinner{width:14px;height:14px;border-radius:50%;border:2px solid var(--line);border-top-color:var(--text);display:inline-block;animation:ux-spin .8s linear infinite!important}
.ux-skeleton-row{display:grid;gap:6px;padding:10px 12px;border:1px solid var(--line);border-radius:var(--ui-radius-control,10px)}
.ux-skeleton-row span{display:block;height:10px;border-radius:6px;background:linear-gradient(90deg,var(--soft) 25%,color-mix(in srgb,var(--soft) 55%,var(--panel)) 50%,var(--soft) 75%);background-size:200% 100%;animation:ux-shimmer 1.2s ease-in-out infinite!important}
.ux-skeleton-row span:first-child{width:45%}.ux-skeleton-row span:last-child{width:75%;height:8px}

/* ---- 결과 없음 ---- */
.ux-empty{display:grid;justify-items:center;gap:6px;padding:28px 16px;text-align:center}
.ux-empty-icon{font-size:26px;opacity:.6}
.ux-empty-title{margin:0;font-weight:600;color:var(--text)}
.ux-empty-hint{margin:0;color:var(--muted);font-size:13px}
.ux-empty button{margin-top:6px}

/* ---- 틀린 칸 ---- */
.ux-invalid{outline:2px solid var(--danger)!important;outline-offset:1px;border-color:var(--danger)!important}
html.ux-motion .ux-shake{animation:ux-shake .35s ease!important}

/* ---- 명령 창(Ctrl+K) ---- */
dialog.ux-palette{width:min(640px,calc(100vw - 24px));max-height:min(560px,calc(100dvh - 80px));margin:12vh auto auto;padding:0;border:1px solid var(--line);border-radius:14px;background:var(--panel);color:var(--text);box-shadow:0 24px 60px #0005;overflow:hidden}
dialog.ux-palette::backdrop{background:#0006}
.ux-palette-box{display:flex;flex-direction:column;max-height:inherit}
.ux-palette-input{display:flex;align-items:center;gap:10px;padding:12px 14px;border-bottom:1px solid var(--line)}
.ux-palette-input>span{font-size:18px;opacity:.6}
.ux-palette-input input{flex:1;border:0!important;outline:0;background:transparent;font-size:15px;height:28px;box-shadow:none!important;padding:0}
.ux-palette-input kbd,.ux-palette-foot span{font:11px/1 inherit;padding:3px 6px;border:1px solid var(--line);border-radius:6px;color:var(--muted)}
.ux-palette-results{overflow:auto;padding:6px;min-height:60px}
.ux-palette-group-title{margin:8px 8px 4px;font-size:12px;color:var(--muted)}
.ux-palette-item{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:36px;padding:6px 10px;border:0;border-radius:10px;background:transparent;color:inherit;text-align:left;cursor:pointer}
.ux-palette-item.active{background:var(--ui-selected-bg,var(--text));color:var(--ui-selected-text,var(--panel))}
.ux-palette-title{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}
.ux-palette-meta{flex:none;max-width:45%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;opacity:.7}
.ux-palette-all-item:not(.active){border:1px dashed var(--line)}
.ux-palette-foot{display:flex;gap:8px;margin:0;padding:8px 12px;border-top:1px solid var(--line)}
@media(max-width:700px){dialog.ux-palette{margin:8px auto auto;max-height:calc(100dvh - 16px)}.ux-palette-foot{display:none}}

/* ---- 상단 '빠른 찾기(Ctrl+K)' 버튼: 앱 다운로드 버튼과 같은 모양(.app-download-shortcut) ---- */
/* 11/16: 버튼 자리를 위해 통합 검색 칸을 조금 좁힌다 */
@media(min-width:1024px){.topbar .global-search{width:clamp(170px,22vw,250px)}}

@media(prefers-reduced-motion:reduce){html.ux-motion #content.ux-enter>*,html.ux-motion dialog[open],html.ux-motion .ux-shake{animation:none!important}}

@media(max-width:1023px){.topbar .ux-palette-open{display:none}}

/* ==== 11/16 밤 앱 효과 1차(ux-pack.js 스위치와 짝). 참고 lucian-uxui-prompt(MIT) 078·079·085·336·071 아이디어, 사이트 색 변수로 새로 만듦 ==== */
.ux-sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* 밀어서 답장(swipeReply): 남의 메시지는 오른쪽으로 밀면 왼쪽에 답장 표시 */
.chat-swipe-reply.from-left{right:auto;left:-48px;transform:translateY(-50%) scaleX(-1)}
html.ux-motion.ux-swipe-reply .messages .message-main:not(.chat-swiping){transition:transform .22s cubic-bezier(.2,.8,.2,1)}
html.ux-motion .chat-swipe-reply{transition:transform .12s ease,outline-color .12s ease}
html.ux-motion .chat-swipe-reply.ready{transform:translateY(-50%) scale(1.12)}
html.ux-motion .chat-swipe-reply.from-left.ready{transform:translateY(-50%) scaleX(-1) scale(1.12)}

/* 목록 첫 로딩 뼈대(listSkeleton) */
.ux-list-skeleton{display:grid;gap:2px;padding:4px 0}
.ux-list-skeleton-row{display:flex;align-items:center;gap:12px;padding:10px 12px;border-bottom:1px solid var(--line)}
.ux-sk-avatar{flex:none;width:32px;height:32px;border-radius:50%;background:var(--soft)}
.ux-sk-lines{flex:1;display:grid;gap:7px;min-width:0}
.ux-sk-lines span{display:block;height:10px;border-radius:6px;background:var(--soft)}
.ux-sk-lines span:first-child{width:42%}.ux-list-skeleton-row:nth-child(3n) .ux-sk-lines span:first-child{width:58%}.ux-list-skeleton-row:nth-child(3n+1) .ux-sk-lines span:first-child{width:34%}.ux-sk-lines span:last-child{width:72%;height:8px}
html.ux-motion .ux-list-skeleton :is(.ux-sk-avatar,.ux-sk-lines span){background:linear-gradient(90deg,var(--soft) 25%,color-mix(in srgb,var(--soft) 55%,var(--panel)) 50%,var(--soft) 75%);background-size:200% 100%;animation:ux-shimmer 1.2s ease-in-out infinite!important}
html.ux-motion .ux-list-skeleton-row{animation:ux-fade .25s ease both!important;animation-delay:calc(var(--ux-i,0) * 40ms)!important}

/* 당겨서 새로고침(pullRefresh, 모바일 폭) */
@media(max-width:700px){html.ux-ptr-on{overscroll-behavior-y:contain}}
.ux-ptr{position:fixed;left:50%;top:calc(var(--mobile-top,56px) - 40px);z-index:46;width:36px;height:36px;margin-left:-18px;display:grid;place-items:center;border-radius:50%;background:var(--panel);color:var(--muted);border:1px solid var(--line);box-shadow:0 4px 14px #0002;opacity:0;pointer-events:none;transform:translateY(var(--ux-pull,0px))}
.ux-ptr.show{opacity:1}
.ux-ptr svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;transform:rotate(calc(var(--ux-pull,0px) / 1px * 3deg))}
.ux-ptr.ready{color:var(--text)}
.ux-ptr.spin svg{animation:ux-spin .8s linear infinite!important}
html.ux-motion .ux-ptr:not(.show),html.ux-motion .ux-ptr.spin{transition:transform .2s ease,opacity .2s ease!important}

/* 아래에서 올라오는 팝업 시트(bottomSheet, 모바일 폭·공통 팝업만) */
@keyframes ux-sheet-up{from{transform:translateY(100%)}to{transform:none}}
@media(max-width:700px){
 html.ux-bottom-sheet #dialog[open]{margin:auto 0 0;width:100%;max-width:100%;max-height:92dvh;border-radius:20px 20px 0 0;border-bottom:0;padding-bottom:calc(18px + env(safe-area-inset-bottom,0px))}
 html.ux-bottom-sheet #dialog[open]::before{content:'';display:block;width:40px;height:4px;margin:-10px auto 12px;border-radius:2px;background:var(--line)}
 html.ux-motion.ux-bottom-sheet #dialog[open]{animation:ux-sheet-up .26s cubic-bezier(.2,.8,.2,1)}
}

/* 메일 삭제 뒤 실행 취소 알림(undoSlide) */
@keyframes ux-toast-up{from{opacity:0;transform:translateY(16px)}to{opacity:1;transform:none}}
html.ux-motion.ux-undo-slide .mail-undo-bar{animation:ux-toast-up .22s cubic-bezier(.2,.8,.2,1)}

@media(prefers-reduced-motion:reduce){html.ux-motion.ux-bottom-sheet #dialog[open],html.ux-motion.ux-undo-slide .mail-undo-bar{animation:ux-fade .15s ease!important}html.ux-motion .ux-list-skeleton-row{animation:none!important}}

/* ---- 11/17 떠 있는 하단 메뉴(floatingTabs): 요즘 iPhone·갤럭시처럼 화면 아래에서 살짝 띄운 둥근 막대 ---- */
@media(max-width:700px){
 html.ux-floating-tabs{--mobile-bottom:calc(66px + env(safe-area-inset-bottom,0px))}
 html.ux-floating-tabs .mobile-tabs{inset:auto max(12px,env(safe-area-inset-right,0px)) calc(8px + env(safe-area-inset-bottom,0px)) max(12px,env(safe-area-inset-left,0px));height:54px;padding:5px;gap:4px;border:1px solid color-mix(in srgb,var(--line) 70%,transparent);border-radius:22px;background:color-mix(in srgb,var(--panel) 78%,transparent);backdrop-filter:blur(22px) saturate(1.6);-webkit-backdrop-filter:blur(22px) saturate(1.6);box-shadow:0 10px 30px rgba(0,0,0,.16),0 2px 8px rgba(0,0,0,.08)}
 [data-theme=dark] html.ux-floating-tabs .mobile-tabs,html.ux-floating-tabs[data-theme=dark] .mobile-tabs{box-shadow:0 12px 32px rgba(0,0,0,.45),0 0 0 1px rgba(255,255,255,.04) inset}
 html.ux-floating-tabs .mobile-tabs>button{height:44px;min-height:44px!important;padding:3px 2px!important;gap:2px;border-radius:17px;color:var(--muted)}
 html.ux-floating-tabs .mobile-tabs>button svg{width:20px;height:20px}
 html.ux-floating-tabs .mobile-tabs>button span:not(.nav-count){font-size:10px;line-height:11px}
 html.ux-floating-tabs .mobile-tabs>button[aria-current=page]{background:var(--ui-selected-bg,var(--text));color:var(--ui-selected-text,var(--panel));font-weight:700;box-shadow:none}
 html.ux-floating-tabs.ux-motion .mobile-tabs>button{transition:background-color .2s ease,color .2s ease,transform .1s ease}
 html.ux-floating-tabs #mobile-create-fab{bottom:calc(var(--mobile-bottom) + 10px)}
}
@media(max-width:700px){
 /* 11/17 대화처럼 높이를 고정한 화면도 내용이 떠 있는 하단바 뒤까지 이어지게: 화면은 끝까지, 마지막 줄은 바 위에서 멈추게 아래 여백 */
 html.ux-floating-tabs .office-shell[data-page=chat] #content{height:calc(100dvh - var(--mobile-top))}
 html.ux-floating-tabs .office-shell[data-page=chat] :is(.room-list,.chat-room-list){padding-bottom:calc(var(--mobile-bottom) + 8px);box-sizing:border-box}
}
