/* AI 비서 화면 간소화 (2026-11-07). 기존 CSS 뒤에 불러와 덮어쓴다. 이 파일의 <link>를 빼면 이전 화면으로 돌아간다. */

/* 1. 최상단: 한 줄 얇은 헤더 */
.app-header{height:46px!important;padding:0 14px!important;gap:14px!important}
.app-header .brand small{display:none}
.app-header .brand strong{font-size:17px}
.app-header .brand-mark{transform:scale(.8)}
.global-nav{gap:2px}
.nav-item{padding:6px 10px!important;font-size:13px!important}
.more-nav summary{font-size:13px;padding:6px 8px}
.header-actions{gap:6px!important}

/* 2. 본문 위의 소개·현황·경로 줄 제거 (자료 올리기는 입력창 클립, 거래 이름은 아래 거래 정보 줄에 있음) */
.workspace-intro,.context-bar,.overview-strip{display:none!important}
.workspace-grid{padding:0 6px 6px!important}

/* 3. 패널 제목과 탭 */
.assistant-panel>.panel-title{min-height:32px!important;padding:3px 12px!important}
.assistant-panel>.panel-title h2{font-size:14px}
.assistant-panel .connection-label{display:none}
.assistant-panel .center-tabs{gap:14px;padding:0 12px}
.assistant-panel .center-tabs button{padding:6px 2px!important;font-size:13px!important;min-height:32px}
.assistant-panel .assistant-context{padding:6px 12px!important;gap:6px}
.assistant-panel .assistant-context .eyebrow{display:none}

/* 4. 본문 영역 여백 최소화 */
body .center-content#assistantView{position:relative;display:flex;flex-direction:column;padding:4px 10px 0!important;font-size:inherit}
#assistantView>.graphical-chat,#assistantView .codex-inline,#assistantView .shared-chat,#assistantView .shared-chat-content{flex:1 1 auto;min-height:0}
#assistantView .shared-chat{display:flex;flex-direction:column}
.graphical-chat{padding:10px clamp(8px,1.6vw,24px)!important}
.graphical-agent-message{max-width:min(100%,1100px)!important;margin:12px auto 16px 0!important}
.graphical-user-message{max-width:min(88%,900px)!important;margin:12px 0 12px auto!important}

/* 5. 대화 목록 · AI 종류 탭 · 대화 탭을 한 구역으로 */
.conversation-toolbar{position:absolute;top:4px;right:10px;z-index:3;padding:0!important}
.conversation-toolbar button{min-height:30px!important;padding:3px 10px!important;font-size:12px}
.ai-session-workspace{margin:0 0 4px!important}
.ai-provider-tabs{padding:0 96px 0 0!important;border-bottom:0!important;gap:4px!important}
.ai-provider-tabs>button{min-height:30px!important;padding:3px 10px!important;border-radius:8px!important;font-size:12.5px!important}
.ai-conversation-tabs{padding-top:3px!important}
.ai-conversation-tablist{padding:1px 1px 3px!important}
.ai-session-tab>[role=tab]{min-height:34px!important;padding:3px 8px!important;flex-direction:row!important;align-items:center!important;gap:8px!important}
.ai-session-title{max-width:160px;font-size:12px}
.ai-session-add{min-height:30px!important;margin-top:1px!important}

/* 6. 설치·계정 안내는 한 줄 링크로 접어 둔다 */
.ai-setup-monitor{margin:0 0 4px!important;border:0!important;background:none!important}
.ai-setup-monitor>summary{padding:2px 4px!important;font-size:12px!important;font-weight:400!important;color:#3e5f74;list-style:none}
.ai-setup-monitor>summary::-webkit-details-marker{display:none}
.ai-setup-monitor>summary>span{display:none!important}
.ai-setup-monitor[open]{border:1px solid #e3d9c4!important;background:#fff!important;border-radius:10px;max-height:38vh;overflow:auto}

/* 7. 대화 중에는 안내 문구·예시·"엔진 연결 전" 문구를 숨긴다 */
#assistantView:has(.graphical-chat:not([hidden])) .assistant-welcome,
#assistantView:has(.graphical-chat:not([hidden])) .assistant-examples,
#assistantView:has(.graphical-chat:not([hidden])) #personalWelcome>p,
#assistantView:has(.graphical-chat:not([hidden])) #personalWelcome>a,
.connection-note{display:none!important}
.shared-chat-status,.codex-inline-status{padding:3px 4px!important;min-height:0!important;border:0!important;background:none!important;font-size:12px}

/* 8. 입력창: 한 덩어리로, 위 안내 줄 제거 */
.assistant-panel .assistant-composer .composer-context{display:none!important}
.assistant-panel .assistant-composer{margin:4px 8px 6px!important;width:auto!important;border-radius:14px!important}
.assistant-panel .assistant-composer .composer-entry textarea{min-height:44px!important}
.assistant-panel .assistant-composer .composer-bottom{padding:0 8px 4px!important;min-height:36px}
.assistant-panel .assistant-composer .composer-icon,#composerVoice .wm-voice-buttons button{width:34px!important;height:34px!important;min-height:34px!important}
.approval-mode{max-width:190px;min-height:30px;height:30px;padding:2px 6px;border:1px solid #e7decc;border-radius:7px;background:#fff;color:#2b4250;font:inherit;font-size:12px}
.approval-mode:focus-visible{outline:2px solid #39586b;outline-offset:2px}

/* 9. 파일 첨부: 끌어다 놓기 표시와 첨부 칩 */
.assistant-panel.codex-dragover{outline:3px dashed #72665a;outline-offset:-6px;background:#f7f4ed}
.assistant-panel.codex-dragover::after{content:"여기에 놓으면 이 대화에 첨부됩니다";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);padding:12px 18px;border-radius:12px;background:#205d4dee;color:#fff;font-size:15px;pointer-events:none;z-index:20}
.assistant-panel{position:relative}
.codex-attachments{display:flex;flex-wrap:wrap;gap:6px;padding:6px 12px 0}
.codex-attachment{display:inline-flex;align-items:center;gap:6px;max-width:100%;padding:3px 4px 3px 6px;border:1px solid #e9e1d1;border-radius:9px;background:#faf8f4;font-size:12px}
.codex-attachment img{width:28px;height:28px;object-fit:cover;border-radius:5px}
.codex-attachment .file-badge{display:inline-flex;align-items:center;justify-content:center;min-width:28px;height:28px;padding:0 4px;border-radius:5px;background:#ede7da;color:#2f4858;font-size:10px;font-weight:700;text-transform:uppercase}
.codex-attachment>span:not(.file-badge){overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:200px}
.codex-attachment button{border:0;background:none;font-size:16px;cursor:pointer;color:#72665a;min-width:24px;min-height:24px}
.codex-attachment-status{margin:0;padding:2px 14px;font-size:12px;color:#3e5f74}.codex-attachment-status:empty{display:none}
.ai-file-chip{display:inline-block;margin-top:6px;padding:3px 8px;border-radius:7px;background:#e9e1d1;font-size:12px}
.graphical-auto-note{margin:6px 0;font-size:12px;color:#3e5f74}

/* 10. 모바일 */
@media(max-width:760px){
  .app-header{height:44px!important}
  body .center-content#assistantView{padding:2px 6px 0!important}
  .ai-provider-tabs{padding-right:84px!important}
  .approval-mode{max-width:120px;font-size:11px}
  .assistant-panel .assistant-composer{margin:3px 4px 4px!important}
}

/* ===== 11. 상단 두 줄 구성 (compact-bar.js가 요소를 옮긴 뒤 적용) ===== */
body .center-content#assistantView.bar-ready{padding-top:0!important}
.assistant-bar{flex:none;display:flex;flex-direction:column;gap:0;padding:6px 0 4px;border-bottom:1px solid #f3efe6;margin-bottom:4px}
.assistant-bar-main{display:flex;align-items:center;gap:8px;min-width:0}
.assistant-bar-main #aiProviderTabs{flex:1 1 auto;min-width:0;padding:0!important;border:0!important;margin:0}
.assistant-bar-tools{display:flex;align-items:center;gap:2px;flex:none;margin-left:auto;min-width:0}
.assistant-bar .private-badge{font-size:11px;margin-right:4px;white-space:nowrap}

/* 줄 1: AI 종류 탭은 얇은 분할 탭, 평상시 보조 문구는 숨김 */
.assistant-bar #aiProviderTabs>button{min-height:30px!important;padding:3px 11px!important;border-radius:8px!important;background:none!important;border:0!important;color:#3e5f74}
.assistant-bar #aiProviderTabs>button[aria-selected=true]{background:#f2ede2!important;color:#283d4a;font-weight:700}
.assistant-bar .is-quiet{display:none!important}

/* 상태·연결: 한 줄, 필요할 때만 글자 표시 */
.assistant-bar .codex-inline-status,.assistant-bar .shared-chat-status{display:flex!important;align-items:center;gap:6px;flex-wrap:nowrap;padding:0!important;margin:0;min-width:0;border:0!important;background:none!important}
.assistant-bar #codexTerminalStatus,.assistant-bar #personalCodexStatus{max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;color:#8a5a2b}
.assistant-bar .codex-work-status{margin:0!important;font-size:12px}
.assistant-bar .ai-connection-control{margin:0!important;gap:2px}
.assistant-bar #terminalAiProvider{display:none!important}                 /* AI 종류 탭과 중복 */
.assistant-bar .ai-connection-control .ai-connection-toggle{width:auto!important;height:30px;min-height:30px;padding:3px 8px;border-color:transparent;background:none;font-size:12px}
.assistant-bar .ai-connection-toggle:hover{background:#f6f3ed}

/* 아이콘 단추: 글자는 숨기고 마우스를 올리면 설명(title) 표시 */
.assistant-bar .bar-icon,.assistant-bar .ai-guide-open,.assistant-bar .ai-session-add{position:relative;display:inline-flex;align-items:center;justify-content:center;flex:none;width:32px!important;height:32px!important;min-height:32px!important;margin:0!important;padding:0!important;border:0!important;border-radius:8px!important;background:none!important;color:#3e5f74;font-size:0!important;cursor:pointer}
.assistant-bar .bar-icon:hover,.assistant-bar .ai-guide-open:hover,.assistant-bar .ai-session-add:hover{background:#f3efe7!important;color:#2f4858}
.assistant-bar .bar-icon:focus-visible,.assistant-bar .ai-guide-open:focus-visible,.assistant-bar .ai-session-add:focus-visible{outline:2px solid #39586b;outline-offset:1px}
.assistant-bar .bar-icon svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.assistant-bar #conversationListOpen::before,.assistant-bar .ai-guide-open::before,.assistant-bar .ai-session-add::before{content:"";width:19px;height:19px;background:currentColor;-webkit-mask:var(--ic) center/contain no-repeat;mask:var(--ic) center/contain no-repeat}
.assistant-bar #conversationListOpen{--ic:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M8 6h13M8 12h13M8 18h13M3.5 6h.01M3.5 12h.01M3.5 18h.01'/%3E%3C/svg%3E")}
.assistant-bar .ai-guide-open{--ic:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v6M12 7.5h.01'/%3E%3C/svg%3E")}
.assistant-bar .ai-session-add{--ic:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");margin-top:0!important}
.assistant-bar .bar-count{position:absolute;top:1px;right:0;min-width:15px;height:15px;padding:0 3px;border-radius:8px;background:#bc2929;color:#fff;font-size:10px;line-height:15px;text-align:center}
.assistant-bar .bar-count[hidden]{display:none}

/* 줄 2: 대화 탭 (+ 새 대화 아이콘). 문구는 짧게 */
.assistant-bar .ai-conversation-tabs{padding:2px 0 0!important;align-items:center!important}
.assistant-bar .ai-conversation-tablist{padding:1px!important}
.assistant-bar .ai-session-tab>[role=tab]{min-height:30px!important;padding:2px 8px!important}
.assistant-bar #aiSessionNotice{margin:2px 0 0;padding:0 4px}

/* 안내·설치 영역은 필요할 때(미연결 자동 안내 또는 아이콘 클릭)만 펼침 */
.ai-setup-monitor:not([open]){display:none!important}
.conversation-toolbar,#aiSessionWorkspace{display:none!important}
.bar-ready .back-to-chat{margin-right:auto}
#tasksView .task-heading{gap:10px;flex-wrap:wrap}

@media(max-width:760px){
  .assistant-bar-main{gap:4px}
  .assistant-bar #aiProviderTabs>button{padding:3px 8px!important;font-size:12px!important}
  .assistant-bar #codexTerminalStatus,.assistant-bar #personalCodexStatus{max-width:90px}
  .assistant-bar .private-badge{display:none}
}
.assistant-bar .ai-conversation-tablist{flex:0 1 auto!important}
@media(max-width:760px){
  .assistant-bar #codexTerminalStatus,.assistant-bar #personalCodexStatus{display:none}
  .assistant-bar #terminalAiToggleText{display:none}
  .assistant-bar .ai-connection-control .ai-connection-toggle{padding:3px 6px}
  .assistant-bar .codex-work-status{font-size:11px}
}

/* 설치 안내: 켰을 때만 본문에 표시, 닫기로 제거 */
.ai-setup-monitor>summary{display:none!important}
.ai-setup-monitor[open]{max-height:none!important;overflow:visible!important;margin:4px 0 8px!important}
.ai-guide-title-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding-top:8px}
.ai-guide-title-row h3{margin:0}
.ai-guide-close{flex:none;min-height:34px;padding:4px 12px;border:1px solid #e3d9c5;border-radius:8px;background:#fff;color:#2b4250;font:inherit;font-size:13px;cursor:pointer}
.ai-guide-close:hover{background:#f6f3ed}.ai-guide-close:focus-visible{outline:2px solid #39586b;outline-offset:2px}
.ai-setup-monitor[open]{overflow-y:auto!important;max-height:min(70dvh,calc(100dvh - 220px))!important}

/* 제목줄: [✦ 무역 AI 비서 · 내부 전용] [비서와 대화] [확인 메모] 한 줄 */
.assistant-panel>.panel-title{display:flex!important;align-items:center;gap:18px;min-height:42px!important;padding:3px 12px!important;border-bottom:1px solid #f3efe6}
.assistant-panel>.panel-title>div:first-child{display:flex;align-items:center;gap:8px;flex:none}
.assistant-panel>.panel-title h2{font-size:15px;white-space:nowrap}
.assistant-panel>.panel-title .private-badge{font-size:11px;white-space:nowrap}
.assistant-panel>.panel-title .center-tabs{display:flex!important;flex:1 1 auto;align-items:center;gap:2px;min-width:0;margin:0;padding:0!important;border:0!important;overflow-x:auto}
.assistant-panel>.panel-title .center-tabs button{flex:none;min-height:32px!important;padding:3px 12px!important;border:0!important;border-radius:8px;background:none;color:#3e5f74;font-size:13px!important;font-weight:500;white-space:nowrap}
.assistant-panel>.panel-title .center-tabs button:hover{background:#f6f3ed}
.assistant-panel>.panel-title .center-tabs button[aria-selected=true]{background:#f2ede2;color:#283d4a;font-weight:700}
.assistant-panel>.panel-title .center-tabs button span{margin-left:5px}
@media(max-width:760px){
  .assistant-panel>.panel-title{gap:8px;min-height:40px!important;padding:2px 8px!important}
  .assistant-panel>.panel-title .assistant-icon,.assistant-panel>.panel-title .private-badge{display:none}
  .assistant-panel>.panel-title h2{font-size:14px}
  .assistant-panel>.panel-title .center-tabs button{padding:3px 9px!important;font-size:12px!important}
}

/* 위로 올려 읽는 중 새 내용이 오면 나타나는 '최신 내용으로' 단추 */
.jump-latest{position:absolute;right:22px;bottom:10px;z-index:6;min-height:34px;padding:5px 14px;border:1px solid #b9b0a6;border-radius:999px;background:#2f4858;color:#fff;font:inherit;font-size:13px;box-shadow:0 4px 14px #1f574c40;cursor:pointer}
.jump-latest[hidden]{display:none}.jump-latest:hover{background:#223641}.jump-latest:focus-visible{outline:3px solid #aea398;outline-offset:2px}

/* 휴대폰에서는 메신저 화면을 넓게 사용하고 하단에서 업무 화면을 전환한다. */
@media(max-width:760px){
 body[data-mobile-panel=chat] .app-header,body[data-mobile-panel=chat] .chat-panel>.panel-title{display:none!important}
 body[data-mobile-panel=chat] .workspace-grid{padding:0!important;gap:0!important}
 body[data-mobile-panel=chat] .chat-panel{border:0!important;border-radius:0!important}
 body[data-mobile-panel=chat] .mobile-panel-nav{min-height:48px;padding-top:1px;padding-bottom:calc(1px + env(safe-area-inset-bottom))}
 body[data-mobile-panel=chat] .mobile-panel-nav button{min-height:44px;gap:1px}
}
@media(max-width:760px){
 body[data-mobile-panel=assistant] .assistant-panel>.panel-title>div:first-child{display:none!important}
 body[data-mobile-panel=assistant] .assistant-panel>.panel-title{min-height:34px!important;gap:4px}
 body[data-mobile-panel=assistant] .assistant-panel>.panel-title .center-tabs button{min-height:30px!important;padding:2px 8px!important}
 body[data-mobile-panel=assistant] .composer-bottom:has(.composer-plus)>[data-action="upload"],body[data-mobile-panel=assistant] .composer-bottom:has(.composer-plus)>#codexImageAdd,body[data-mobile-panel=assistant] .composer-bottom:has(.composer-plus)>[data-action="guide"]{display:none!important}
}
.mobile-header-ai,.mobile-header-nav,.mobile-settings-button,.mobile-setting-row{display:none}
@media(max-width:760px){
 body[data-mobile-panel=assistant] .app-header{display:flex!important;gap:6px;padding:0 8px!important;height:44px!important;min-height:44px}
 body[data-mobile-panel=assistant] .app-header .brand{gap:5px;flex:none}
 body[data-mobile-panel=assistant] .app-header .brand strong{font-size:15px;white-space:nowrap}
 body[data-mobile-panel=assistant] .app-header .brand-mark{transform:scale(.75);transform-origin:left center;margin-right:-4px}
 body[data-mobile-panel=assistant] .app-header .global-nav,body[data-mobile-panel=assistant] .app-header .header-actions{display:none!important}
 .mobile-header-ai{display:block;margin-left:auto;min-width:0;flex:0 1 auto}.mobile-header-ai .provider-select{flex:none}.mobile-header-ai .provider-select-menu{left:auto;right:0}
 .mobile-header-nav{display:block;position:relative;flex:none}.mobile-nav-toggle,.mobile-settings-button{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;padding:0;border:0;border-radius:8px;background:transparent;color:#334e5e;font-size:22px;cursor:pointer}.mobile-settings-button svg{width:21px;height:21px}
 .mobile-nav-menu{position:absolute;right:0;top:100%;z-index:150;min-width:170px;padding:5px;border:1px solid #e6ddca;border-radius:10px;background:white;box-shadow:0 8px 26px #173c2928}.mobile-nav-menu[hidden]{display:none}.mobile-nav-menu button{display:block;width:100%;padding:10px 12px;text-align:left;color:#283d4a;font:inherit;font-size:14px;border:0;background:transparent}.mobile-nav-menu button:hover{background:#f4f0e9}
 body[data-mobile-panel=assistant] .mobile-panel-nav{display:none!important}
 body[data-mobile-panel=assistant] .assistant-panel>.panel-title{gap:2px;min-height:38px!important}
 body[data-mobile-panel=assistant] .assistant-panel>.panel-title .center-tabs button{padding:2px 5px!important}
 body[data-mobile-panel=assistant] .work-status-button{height:30px}.work-status .ws-chip{padding:0 5px}
 body[data-mobile-panel=assistant] .assistant-bar{display:none!important}
 body[data-mobile-panel=assistant] .assistant-composer .composer-bottom{display:none!important}
 body[data-mobile-panel=assistant] .composer-entry{grid-template-columns:38px minmax(0,1fr) 38px 40px!important;padding:2px 3px!important}
 body[data-mobile-panel=assistant] .composer-entry>.composer-plus{grid-column:1;grid-row:1;align-self:end}
 body[data-mobile-panel=assistant] #composerVoice .tts-read-group{display:none!important}
 body[data-mobile-panel=assistant] .composer-entry textarea{grid-column:2}
 body[data-mobile-panel=assistant] #composerVoice [data-wm-voice=dictate]{grid-column:3}
 body[data-mobile-panel=assistant] .composer-entry .send-button{grid-column:4}
 .mobile-setting-row{display:block;margin:14px 0;font-size:13px;color:#345061}.mobile-setting-row select{display:block;max-width:100%;margin-top:6px}.mobile-setting-row button{display:block;margin-top:6px}
}

@media(max-width:760px){body[data-mobile-panel=assistant]{height:var(--mobile-visible-height,100dvh)!important;max-height:var(--mobile-visible-height,100dvh)}}

@media(max-width:760px){body[data-mobile-panel=chat] .mobile-panel-nav,body[data-mobile-panel=chat] .chat-boundary{display:none!important}}
/* 거래·자료 화면도 상단 메뉴로 이동하고 하단 중복 탐색은 표시하지 않는다. */
@media(max-width:760px){
 body:has(.mobile-header-nav)[data-mobile-panel=materials] .mobile-panel-nav{display:none!important}
 body:has(.mobile-header-nav)[data-mobile-panel=materials] .app-header{display:flex!important;gap:6px;padding:0 8px!important;height:44px!important;min-height:44px}
 body:has(.mobile-header-nav)[data-mobile-panel=materials] .app-header .brand{gap:5px;flex:none}
 body:has(.mobile-header-nav)[data-mobile-panel=materials] .app-header .brand strong{font-size:15px;white-space:nowrap}
 body:has(.mobile-header-nav)[data-mobile-panel=materials] .app-header .brand-mark{transform:scale(.75);transform-origin:left center;margin-right:-4px}
 body:has(.mobile-header-nav)[data-mobile-panel=materials] .app-header .global-nav,body:has(.mobile-header-nav)[data-mobile-panel=materials] .app-header .header-actions{display:none!important}
}
/* 모바일에서도 자동 읽기 스피커를 입력창 한 줄에 둔다. 속도 선택은 설정에 유지한다. */
@media(max-width:760px){
 body[data-mobile-panel=assistant] .composer-entry{grid-template-columns:34px 34px minmax(0,1fr) 34px 40px!important}
 body[data-mobile-panel=assistant] #composerVoice .tts-read-group{display:flex!important;grid-column:2!important;grid-row:1;align-self:end}
 body[data-mobile-panel=assistant] .composer-entry textarea{grid-column:3!important}
 body[data-mobile-panel=assistant] #composerVoice [data-wm-voice=dictate]{grid-column:4!important}
 body[data-mobile-panel=assistant] .composer-entry .send-button{grid-column:5!important}
}
