/* ChatVOT unified responsive shell: routing owns visibility. */
.cv-mode-brand{display:none}
:root{--cv-safe-bottom:env(safe-area-inset-bottom,0px)}
html{scroll-padding-bottom:calc(90px + var(--cv-safe-bottom))}
body{overflow-x:hidden}
.workspace,.workspace *{min-width:0}
#q{max-width:100%;resize:vertical;min-height:64px;max-height:min(42dvh,340px);overflow-y:auto}
.compose{max-width:100%;min-width:0}
.compose-bottom{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
#sidebar{max-height:100dvh;overflow-y:auto;overscroll-behavior:contain}
@media(max-width:767px){
  .workspace{width:100%;max-width:100%;padding-left:clamp(10px,3vw,20px);padding-right:clamp(10px,3vw,20px)}
  .compose{width:100%;padding-bottom:max(8px,var(--cv-safe-bottom))}
  .workspace-modes{flex-shrink:0}
  button,input,textarea{touch-action:manipulation}
  #q{font-size:16px}
  body.cv-tool-open{overflow:hidden}
  .cv-tool-view{position:fixed;inset:0;z-index:1000;background:var(--bg,#fbf9f1);display:flex;flex-direction:column;padding-top:env(safe-area-inset-top,0px);padding-bottom:var(--cv-safe-bottom)}
  .cv-tool-view[hidden]{display:none}
  .cv-tool-view iframe{flex:1;width:100%;border:0;background:white}
}
@media(min-width:768px){
  .cv-tool-view{position:fixed;inset:5vh 3vw;z-index:1000;background:var(--bg,#fbf9f1);border:1px solid var(--line,#ddd);border-radius:16px;box-shadow:0 20px 70px #0005;display:flex;flex-direction:column;overflow:hidden}
  .cv-tool-view[hidden]{display:none}
  .cv-tool-view iframe{flex:1;width:100%;border:0;background:white}
}
.cv-tool-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px;background:#f8f7ee;color:#214237;border-bottom:1px solid #d6dfd6}
.cv-tool-toolbar button{padding:10px 14px;border:1px solid #9db7aa;border-radius:10px;background:white;color:#214237;font:inherit;cursor:pointer}
.cv-tool-title{font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* Approved ChatVOTImmoAI visual: scoped to Chat/Travail, never the home screen. */
body:is([data-work-mode="chat"],[data-work-mode="work"]) .workspace-header{grid-template-columns:auto minmax(0,1fr) auto auto;background:#fffdf5;color:#173d31;border-bottom:1px solid #e5e7da}
body:is([data-work-mode="chat"],[data-work-mode="work"]) .workspace-modes{display:flex;align-items:center;justify-content:center;gap:3px;padding:4px;border-radius:999px;background:#f0f1e9;border:1px solid #e2e4d8}
body:is([data-work-mode="chat"],[data-work-mode="work"]) .workspace-modes button{border-radius:999px;min-height:42px;padding:8px 20px;color:#214637;background:transparent;border:0}
body:is([data-work-mode="chat"],[data-work-mode="work"]) .workspace-modes button[aria-pressed="true"]{background:#07513b;color:#fff;box-shadow:0 2px 7px #002a1b25}
body:is([data-work-mode="chat"],[data-work-mode="work"]) .cv-mode-brand{display:flex;align-items:center;gap:8px;min-width:0;font-weight:750;color:#0b4432}
body:is([data-work-mode="chat"],[data-work-mode="work"]) .cv-mode-brand img{width:38px;height:38px;object-fit:contain}
body:is([data-work-mode="chat"],[data-work-mode="work"]) .cv-mode-brand span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body:is([data-work-mode="chat"],[data-work-mode="work"]) #copilot #msgs{background:#fffdf5}
body:is([data-work-mode="chat"],[data-work-mode="work"]) #copilot .compose{border-radius:22px;background:#fffdf5;border:1px solid #d5e1d8}
@media(max-width:760px){
 body:is([data-work-mode="chat"],[data-work-mode="work"]) .workspace-header{display:flex;flex-wrap:wrap;justify-content:space-between;gap:4px;padding-bottom:8px}
 body:is([data-work-mode="chat"],[data-work-mode="work"]) .cv-mode-brand{order:0;flex:1 1 100px;justify-content:flex-start;font-size:15px}
 body:is([data-work-mode="chat"],[data-work-mode="work"]) .cv-mode-brand img{width:46px;height:36px}
 body:is([data-work-mode="chat"],[data-work-mode="work"]) .workspace-modes{order:3;flex:0 0 auto;width:min(72%,260px);box-sizing:border-box;margin:0 auto}
 body:is([data-work-mode="chat"],[data-work-mode="work"]) .workspace-modes button{flex:1;min-width:0}
 body:is([data-work-mode="chat"],[data-work-mode="work"]) .header-label{display:none}
 body:is([data-work-mode="chat"],[data-work-mode="work"]) .cv-mode-brand span{max-width:170px}
}

/* Edge-to-edge mobile workspace. Home and account keep their existing page flow. */
@media(max-width:760px){
 body:is([data-work-mode="chat"],[data-work-mode="work"]){position:fixed;inset:var(--cv-viewport-top,0px) 0 auto;height:var(--app-height,100dvh);min-height:0;display:flex;flex-direction:column;overflow:hidden;background:#fffdf5}
 body:is([data-work-mode="chat"],[data-work-mode="work"]) .workspace-header{flex:0 0 auto;position:relative;margin:0;width:100%;box-sizing:border-box;z-index:5;padding-top:max(4px,env(safe-area-inset-top,0px));padding-bottom:4px;min-height:0;box-shadow:0 2px 12px #173b2510}
 body:is([data-work-mode="chat"],[data-work-mode="work"]) .header-left #viewTitle{display:none}
 body:is([data-work-mode="chat"],[data-work-mode="work"]) .international-notice{flex:0 0 auto;max-height:28px;overflow:auto;margin:0;padding:2px 12px;font-size:10px;line-height:1.3}
 body:is([data-work-mode="chat"],[data-work-mode="work"]) main.workspace{flex:1 1 0;min-height:0;height:auto;max-height:none;min-width:0;width:100%;max-width:none;margin:0;padding:0;box-sizing:border-box;overflow:auto;background:#fffdf5}
 body[data-work-mode="work"] main.workspace>[data-active-work]{width:100%;max-width:none;min-height:100%;box-sizing:border-box;margin:0;padding:12px;overflow:visible}
 body[data-work-mode="chat"] main.workspace{display:flex;flex-direction:column;overflow:hidden}
 body[data-work-mode="chat"] main.workspace>#copilot{display:flex;flex-direction:column;flex:1 1 0;min-height:0;height:auto;max-height:none;max-width:none;width:100%;margin:0;padding:0;overflow:hidden;border:0;border-radius:0;background:#fffdf5}
 body[data-work-mode="chat"] #copilot>.card{display:flex;flex-direction:column;flex:1 1 0;min-height:0;height:auto;max-height:none;max-width:none;width:100%;box-sizing:border-box;overflow:hidden;padding:0 8px 0;border:0;border-radius:0;box-shadow:none;background:#fffdf5}
 body[data-work-mode="chat"] #copilot #msgs{order:1;display:flex;flex-direction:column;flex:1 1 0;min-height:0;min-width:0;max-height:none;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;padding:12px 6px;gap:5px;scrollbar-width:thin}
 body[data-work-mode="chat"] #copilot .msg{max-width:94%;line-height:1.55;border-radius:18px;padding:12px 14px;overflow-wrap:anywhere}
 body[data-work-mode="chat"] #copilot .msg.user{background:#07513b;color:#fff}
 body[data-work-mode="chat"] #copilot .copilot-welcome{box-sizing:border-box;min-height:0;max-width:100%;flex:0 0 auto;margin:auto 0;padding:16px 4px}
 body[data-work-mode="chat"] #copilot .copilot-welcome .prompt-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 body[data-work-mode="chat"] #copilot .compose{order:5;display:grid;grid-template-columns:36px minmax(0,1fr) 36px 40px;align-items:center;gap:4px;flex:0 0 auto;max-height:calc(var(--app-height,100dvh)*.38);width:auto;min-width:0;box-sizing:border-box;overflow-y:auto;padding:6px 8px;margin:4px 0 max(4px,var(--cv-safe-bottom));border:1px solid #d5e1d8;border-radius:26px;background:#fffdf5;box-shadow:0 3px 14px #123c2a0d}
 body[data-work-mode="chat"] #copilot #q{grid-column:2;grid-row:1;width:100%;box-sizing:border-box;min-height:36px;max-height:calc(var(--app-height,100dvh)*.22);resize:none;padding:7px 4px;margin:0;border:0;background:transparent;color:#173d31;outline-offset:2px;font-size:16px;line-height:1.4}
 body[data-work-mode="chat"] #copilot .compose-bottom{display:contents}
 body[data-work-mode="chat"] #copilot .compose-tools{grid-column:1;grid-row:1;margin:0}
 body[data-work-mode="chat"] #copilot #attachmentCount{display:none}
 body[data-work-mode="chat"] #copilot #voiceStart{grid-column:3;grid-row:1}
 body[data-work-mode="chat"] #copilot #sendChat{grid-column:4;grid-row:1;background:#07513b;color:#fff}
 body[data-work-mode="chat"] #copilot :is(#attachmentPlus,#voiceStart,#sendChat){width:36px;height:36px;min-width:36px;min-height:36px;border-radius:50%;padding:6px;margin:0}
 body[data-work-mode="chat"] #copilot .compose>:is(.attachment-menu,.attachment-status,.attachment-disclosure){grid-column:1/-1;max-width:100%;margin:0}
 body[data-work-mode="chat"] #copilot .composer-note{display:none}
 body[data-work-mode="chat"] #copilot .chat-access{order:2;flex:0 0 auto;gap:6px;padding:3px 6px;margin:0;font-size:11px;border:0;background:transparent}
 body[data-work-mode="chat"] #copilot .chat-access .secondary{width:auto;min-height:34px;padding:4px 8px}
 body[data-work-mode="chat"] #copilot .voice-panel{order:3;flex:0 0 auto;max-height:24%;overflow-y:auto;margin:0;padding:2px 4px;font-size:10px}
 body[data-work-mode="chat"] #copilot>.workspace-save-panel{flex:0 0 auto;max-height:18%;overflow:auto;padding:2px 12px;margin:0;background:#fffdf5}
 body[data-work-mode="chat"] #copilot>.workspace-save-panel>p{display:inline;font-size:10px;margin:0}
 body[data-work-mode="chat"] #copilot>.workspace-save-panel>details>summary{font-size:10px}
 body[data-work-mode="chat"] :is(#chatStatus,#chatStop){order:4;flex:0 0 auto}
 body[data-work-mode="chat"] #chatStatus:not(:empty){max-height:18%;overflow:auto;margin:2px 4px;font-size:11px}
}

/* Quick navigation stays attached to the conversation. */
body:not([data-work-mode="chat"]) #cv-quick-actions{display:none!important}
.cv-quick-actions{display:flex;align-items:center;gap:8px;overflow-x:auto;overscroll-behavior-x:contain;padding:8px 2px 12px;flex:0 0 auto;scrollbar-width:none}
.cv-quick-actions::-webkit-scrollbar{display:none}
.cv-quick-actions button{flex:0 0 auto;min-height:38px;padding:7px 13px;border-radius:999px;border:1px solid #d7dfd2;background:#f6f7ee;color:#1c513e;font:600 12px system-ui;white-space:nowrap}
.cv-quick-actions button:focus-visible{outline:2px solid #0c6848;outline-offset:2px}
@media(max-width:760px){body[data-work-mode="chat"] #copilot .cv-quick-actions{width:100%;box-sizing:border-box;margin:0;padding:6px 2px;gap:6px}body[data-work-mode="chat"] #copilot .cv-quick-actions button{font-size:11px;min-height:32px;padding:5px 10px}}

/* Conversation utilities live in a real dialog, keeping the message surface clear. */
.cv-chat-settings{width:min(580px,calc(100vw - 24px));max-height:calc(var(--app-height,100dvh) - 24px);box-sizing:border-box;padding:16px;border:1px solid #d7dfd2;border-radius:20px;background:#fffdf5;color:#173d31;overflow:auto}
.cv-chat-settings::backdrop{background:#173d3166}
.cv-settings-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.cv-settings-bar h2{font:700 17px/1.3 system-ui;margin:0}
.cv-settings-bar button,.cv-chat-settings>button{min-height:40px;padding:8px 12px;border:1px solid #d7dfd2;border-radius:12px;background:#f4f6ee;color:#173d31;font:inherit}
.cv-settings-content{display:grid;gap:12px;margin-top:14px}
.cv-settings-content .international-notice{margin:0;padding:10px;font-size:12px;max-height:none}
.cv-settings-content .chat-access{margin:0;font-size:12px}
.cv-settings-content .voice-panel{margin:0;padding:10px;border:1px solid #d7dfd2;border-radius:12px;font-size:12px;max-height:none}
#cv-save-alert:empty{display:none}
#cv-save-alert{order:4;flex:0 0 auto;max-height:48px;overflow:auto;margin:2px 4px;font:12px/1.4 system-ui;color:#8b2424}
@media(max-width:760px){
 body:is([data-work-mode="chat"],[data-work-mode="work"]) .workspace-header{gap:2px 4px;padding-left:8px;padding-right:8px}
 body:is([data-work-mode="chat"],[data-work-mode="work"]) .header-left{gap:0}
 body:is([data-work-mode="chat"],[data-work-mode="work"]) #sidebarToggle{width:34px;min-width:34px;height:38px;padding:0;border:0;background:transparent;border-radius:8px}
 body:is([data-work-mode="chat"],[data-work-mode="work"]) .header-locale-tools{gap:2px;flex:0 0 auto}
 body:is([data-work-mode="chat"],[data-work-mode="work"]) .header-locale-tools .international-open{width:30px;min-width:30px;height:34px;min-height:34px;padding:2px;border:0;background:transparent;border-radius:8px;font-size:19px}
 body:is([data-work-mode="chat"],[data-work-mode="work"]) .header-account{min-height:34px}
 body:is([data-work-mode="chat"],[data-work-mode="work"]) .header-account .avatar{width:30px;min-width:30px;height:30px;font-size:11px}
 body:is([data-work-mode="chat"],[data-work-mode="work"]) .cv-mode-brand{gap:4px;flex:1 1 140px;justify-content:flex-start;font-size:15px}
 body:is([data-work-mode="chat"],[data-work-mode="work"]) .cv-mode-brand span{max-width:none}
 body:is([data-work-mode="chat"],[data-work-mode="work"]) .workspace-modes{padding:2px;gap:2px;margin-top:2px;margin-bottom:2px}
 body:is([data-work-mode="chat"],[data-work-mode="work"]) .workspace-modes button{font-size:12px;min-height:30px;padding:4px 12px}
 body[data-work-mode="chat"] #copilot .compose{padding:4px 6px;gap:2px;margin-top:4px;min-height:46px;max-height:calc(var(--app-height,100dvh)*.3)}
 body[data-work-mode="chat"] #copilot #q{outline:none;height:36px;line-height:1.35}
 body[data-work-mode="chat"] #copilot .compose:focus-within{border-color:#2c6854;box-shadow:0 0 0 2px #2c685426}
 body[data-work-mode="chat"] #copilot .compose>.attachment-menu{position:static;inset:auto;width:100%;max-height:calc(var(--app-height,100dvh)*.2);overflow:auto;box-sizing:border-box}
 body[data-work-mode="chat"] #copilot .copilot-welcome{margin:auto 0;padding:12px 6px}
 body[data-work-mode="chat"] #copilot .copilot-welcome .eyebrow{display:none}
 body[data-work-mode="chat"] #copilot .copilot-welcome h1{font-size:23px;line-height:1.2;margin:0 0 12px}
 body[data-work-mode="chat"] #copilot .copilot-welcome>p{font-size:13px;line-height:1.5;margin:0}
 body[data-work-mode="chat"] #copilot .copilot-welcome .prompt-grid{margin-top:14px;gap:6px;grid-template-columns:1fr}
 body[data-work-mode="chat"] #copilot .copilot-welcome .prompt-grid button{min-height:44px;padding:8px 10px;display:grid;grid-template-columns:24px 1fr;gap:3px 8px}
 body[data-work-mode="chat"] #copilot .copilot-welcome .prompt-grid b{font-size:12px}
 body[data-work-mode="chat"] #copilot .copilot-welcome .prompt-grid small{display:none}
 body[data-work-mode="chat"] #copilot .cv-quick-actions{gap:4px;padding:4px 0 6px}
 body[data-work-mode="chat"] #copilot .cv-quick-actions button{flex:1 0 auto;font-size:10px;min-height:30px;padding:4px 7px}
 body:is([data-work-mode="chat"],[data-work-mode="work"]) #immoNotifications{position:static;inset:auto;display:block;min-height:0;padding:0;border:0;background:transparent;flex:0 0 30px;width:30px;z-index:auto}
 body:is([data-work-mode="chat"],[data-work-mode="work"]) #immoNotifications .immo-notifications-toggle{width:30px;min-width:30px;height:34px;min-height:34px;margin:0;padding:0;border:0;border-radius:8px;background:transparent url('/chatvot-bell.svg') center/18px no-repeat;box-shadow:none;font-size:0}
 body:is([data-work-mode="chat"],[data-work-mode="work"]) #immoNotificationPanel{position:fixed;top:48px;right:8px;z-index:950;max-height:calc(var(--app-height,100dvh) - 64px);width:min(380px,calc(100vw - 16px));font-size:13px}
 body[data-work-mode="chat"] #copilot .cv-chat-settings .chat-access{display:flex;font-size:12px;padding:10px;max-height:none}
 body[data-work-mode="chat"] #copilot .cv-chat-settings .voice-panel{order:initial;max-height:none;font-size:12px;padding:10px}
 body[data-work-mode="chat"] #cv-chat-settings .international-notice{max-height:none;margin:0;padding:10px;font-size:12px}
 body[data-work-mode="chat"] #copilot .msg{font-size:14px;line-height:1.5;margin:8px 0;max-width:90%}
 body[data-work-mode="chat"] #copilot .msg.user{margin-left:auto}
 body[data-work-mode="chat"] #copilot .msg.ai{max-width:100%;padding:8px 4px;color:#173d31}
 body[data-work-mode="chat"] #copilot .msg.ai::before{content:'ChatVOTImmoAI';display:block;margin-bottom:8px;padding-left:34px;min-height:24px;background:url('/vot-logo-creme.png') left center/30px 24px no-repeat;font:750 13px/24px system-ui;color:#173d31}
}
@media(max-width:360px){body:is([data-work-mode="chat"],[data-work-mode="work"]) .cv-mode-brand{font-size:12px;flex-basis:100px}body:is([data-work-mode="chat"],[data-work-mode="work"]) .cv-mode-brand img{width:36px;height:32px}}


/* Desktop conversation: retain the approved shell and give deliverables the viewport. */
@media(min-width:761px){
 body[data-work-mode="chat"]{height:var(--app-height,100dvh);min-height:0;overflow:hidden}
 body[data-work-mode="chat"] main.workspace{height:calc(var(--app-height,100dvh) - var(--cv-header-height,78px));min-height:0;display:flex;flex-direction:column;overflow:hidden;padding-top:12px;padding-bottom:8px;box-sizing:border-box}
 body[data-work-mode="chat"] main.workspace>#copilot{display:flex;flex-direction:column;flex:1 1 0;min-height:0;height:100%;max-height:none;max-width:none;width:100%;overflow:hidden}
 body[data-work-mode="chat"] #copilot>.card{display:flex;flex-direction:column;flex:1 1 0;min-height:0;height:100%;max-height:none;width:100%;padding:0;overflow:hidden}
 body[data-work-mode="chat"] #copilot #msgs{flex:1 1 0;min-height:0;max-height:none;overflow-y:auto;overscroll-behavior:contain}
 body[data-work-mode="chat"] #copilot .cv-quick-actions{flex:0 0 auto;margin:0;padding:4px 0 8px}
 body[data-work-mode="chat"] #copilot .compose{flex:0 0 auto;padding:6px 12px;margin:6px 0 0}
 body[data-work-mode="chat"] #copilot #q{min-height:36px;max-height:128px;padding:4px 0}
 body[data-work-mode="chat"] #copilot .compose-bottom{min-height:36px}
 body[data-work-mode="chat"] #copilot .composer-note{margin:4px 0 0;font-size:10px;flex:0 0 auto}
}
