/* Dedicated conversation layout; other pages retain their existing sizing. */
.conversation-main{max-width:none;margin:0;padding:20px 24px;align-self:start}
.conversation-main #page-chat:not(.hidden){height:calc(100dvh - 40px);min-height:620px;display:flex;flex-direction:column}
#page-chat>.top{margin-bottom:12px}#page-chat .top h1{font-size:25px}#page-chat .top .muted{font-size:13px}
.conversation-heading{display:flex;gap:12px;align-items:end;margin-bottom:8px;min-width:0}
.current-conversation{flex:1;min-width:0}.current-conversation>label{margin:0 0 5px;font-size:11px;letter-spacing:.4px}
.current-conversation select{padding:10px 12px;height:42px}
.conversation-controls{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:0}.conversation-controls .btn{padding:10px 12px;font-size:12px;min-height:42px}
#chatStatus{font-size:12px;margin-bottom:9px!important;min-height:17px}
#page-chat .conversation-space{flex:1;height:auto;min-height:0;gap:10px;padding:16px;box-shadow:none;overflow:visible}
#page-chat .messages{min-height:200px;padding:6px 10px 14px 4px;gap:18px;scrollbar-width:thin;scrollbar-color:#365975 #0a1726}
#page-chat .msg{max-width:min(100%,1200px);line-height:1.7;font-size:15px;padding:16px 20px}
#page-chat .msg.ai{width:100%;border-radius:16px;background:#0c1b2d}
#page-chat .msg.ai.has-media{width:fit-content;max-width:min(100%,1000px)}
#page-chat .msg.user{max-width:85%;width:fit-content}
#page-chat .msg h3{font-size:18px;color:#d9f0ff;line-height:1.45;margin:12px 0}
.compose-shell{flex:none;padding-top:10px}.compose-shell .chatbar{padding-top:0;border-top:0;grid-template-columns:minmax(0,1fr) 154px;gap:12px;align-items:stretch}
.input-shell{border:1px solid #35516b;border-radius:15px;background:#071320;min-width:0;display:flex;flex-direction:column}
.input-shell:focus-within{border-color:#6ed5ff;box-shadow:0 0 0 2px #63cfff20}
.compose-shell #chatInput{width:100%;min-height:74px;max-height:180px;border:0;border-radius:15px 15px 0 0;resize:vertical;padding:13px 15px;font-size:15px;background:transparent;outline:none}
.input-settings{display:flex;gap:8px;align-items:center;padding:7px 12px;border-top:1px solid #22394b;min-width:0}
.input-settings>label{margin:0;font-size:11px}.input-settings #chatMode{width:auto;max-width:calc(100% - 55px);padding:5px 8px;font-size:12px;border-radius:8px;background:#102438}
.compose-actions{display:flex;flex-direction:column;gap:8px;justify-content:flex-end}.compose-actions #newChat{font-size:12px;padding:11px 8px}.compose-actions #chatSend{min-height:58px;font-size:15px}
.compose-attachments .file-tools{margin:8px 0 0;align-items:center;gap:10px}.compose-attachments .file-tools>label{margin:0;font-size:12px;padding:8px 11px}.compose-attachments .small{font-size:11px}
.compose-tools{margin-top:8px;gap:8px}.compose-tools>label{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}.compose-tools input[type=checkbox]{width:auto;margin:0;accent-color:#64cfff}
.compose-note{display:none}.image-options{margin-top:6px}.image-options>summary{font-size:11px}.image-options[open]{max-height:180px;overflow:auto}
.code-artifact,.attachment-card{white-space:normal;border:1px solid #2e4a62;background:#081624;border-radius:12px;margin:12px 0;overflow:hidden}
.code-artifact>summary{display:flex;align-items:center;gap:10px;padding:11px 13px;cursor:pointer;list-style:none}.code-artifact>summary::-webkit-details-marker{display:none}
.artifact-icon{display:grid;place-items:center;flex:none;width:33px;height:33px;border-radius:9px;background:#19334b;color:#8edcff;font-size:13px;font-weight:700}
.artifact-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.artifact-info strong{font-size:13px;overflow-wrap:anywhere}.artifact-info small{font-size:11px;color:var(--muted)}
.artifact-disclosure{font-size:12px;color:#9ed9fa;white-space:nowrap}.artifact-actions{display:flex;flex-wrap:wrap;gap:7px;padding:0 12px 11px}.artifact-actions .btn{padding:6px 10px;font-size:11px;min-height:30px}
.code-artifact pre{margin:0;border-top:1px solid #294359;padding:14px;max-height:340px;overflow:auto;white-space:pre;font:13px/1.65 Consolas,monospace;color:#dfedfc;tab-size:4}
.attachment-card{display:flex;align-items:center;gap:10px;padding:11px 13px}.attachment-card .btn{font-size:12px;padding:8px 10px}
.generated-media{display:block;width:fit-content;max-width:100%;border:1px solid #2d465e;border-radius:14px;padding:12px;background:#071421;white-space:normal}
.media-caption{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:10px;font-size:13px}.media-caption small{color:var(--muted);font-size:11px}
#page-chat .generated-media img{width:auto;height:auto;max-width:min(680px,100%);max-height:350px;object-fit:contain;display:block;border-radius:9px;margin:0 auto;background:#050d17}
.media-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}.media-actions .btn{font-size:12px;padding:9px 12px;margin:0}
.progress-popup-host{right:0;bottom:calc(100% + 12px)}
.code-file{border:1px solid #2e4a62;background:#081624;border-radius:12px;margin:12px 0;overflow:hidden;white-space:normal}.code-file .code-artifact{border:0;margin:0;border-radius:0}.code-file .artifact-actions{padding-top:0}
.hero.scene-banner{display:block;padding:0;gap:0;width:100%;height:clamp(240px,34vw,490px);min-height:0;background:#071421;isolation:isolate;overflow:hidden}
.scene-banner:before{content:'';position:absolute;inset:-25px;background:url('/static/nemesis-scene.jpg') center/cover;filter:blur(24px);opacity:.3;z-index:-1}
.hero.scene-banner .hero-image{display:block;width:100%;height:100%;max-height:none;aspect-ratio:auto;object-fit:contain;border-radius:0;position:relative}
.scene-banner canvas{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
@media(min-width:1600px){#page-chat .msg.ai{max-width:1400px}#page-chat .generated-media img{max-height:400px}}
@media(max-width:900px){.conversation-main{padding:16px}.conversation-main #page-chat:not(.hidden){height:calc(100dvh - 32px);min-height:680px}.conversation-heading{align-items:stretch;flex-wrap:wrap}.current-conversation{flex-basis:100%}.conversation-controls{margin-bottom:2px}#page-chat .top{display:none}#page-chat .msg{padding:14px;font-size:14px}#page-chat .conversation-space{padding:12px}.attachment-card{flex-wrap:wrap}}
@media(max-width:560px){.conversation-main{padding:10px}.conversation-main #page-chat:not(.hidden){height:auto;min-height:0}#page-chat .conversation-space{height:78dvh;min-height:580px;flex:none}.conversation-controls .btn{padding:8px 10px;font-size:11px;min-height:35px}.compose-shell .chatbar{grid-template-columns:minmax(0,1fr) 108px;gap:8px}.compose-actions #newChat{font-size:10px;line-height:1.4;padding:9px 6px}.compose-actions #chatSend{padding:12px 6px;min-height:50px;font-size:13px}.input-settings{padding:6px}.input-settings>label{display:none}.input-settings #chatMode{max-width:calc(100% - 22px);font-size:11px;padding:5px;min-width:0}.compose-attachments .file-tools>.small{display:none}#page-chat .msg{padding:12px;max-width:100%}.artifact-disclosure{font-size:11px}#page-chat .generated-media img{max-height:300px}.media-caption{flex-wrap:wrap;gap:4px}.image-options[open]{max-height:130px}}

/* Compact conversation controls and folder attachments. */
.hero.scene-banner{height:clamp(280px,42vw,660px)}
.hero.scene-banner .hero-image{object-fit:cover;object-position:center}
.scene-banner:before{display:none}
.compose-shell .chatbar{grid-template-columns:minmax(0,1fr) 220px;align-items:stretch}
.compose-actions{justify-content:flex-start;gap:6px;min-width:0}
.compose-actions #newChat{padding:8px 6px;font-size:11px}
.compose-actions #chatSend{min-height:44px}
.compose-actions .conversation-heading{display:block;margin:2px 0 0;min-width:0}
.compose-actions .current-conversation>label{font-size:10px;margin-bottom:3px}
.compose-actions .current-conversation select{height:31px;padding:4px 7px;font-size:11px;width:100%;min-width:0}
.compose-actions .conversation-controls{gap:4px;margin-top:5px;flex-wrap:wrap}
.compose-actions .conversation-controls .btn{font-size:10px;min-height:27px;padding:4px 7px}
.compose-actions #chatStatus{font-size:10px;line-height:1.4;margin:0!important;overflow-wrap:anywhere;max-height:42px;overflow:auto}
.compose-shell #chatInput{min-height:130px;max-height:260px;flex:1}
.attachment-bar{display:flex;align-items:flex-start;gap:8px;margin-bottom:5px;min-width:0}
.attachment-bar .attachment-plus{display:grid;place-items:center;margin:0;padding:0;width:30px;height:30px;min-width:30px;border-radius:9px;font-size:23px;line-height:1;cursor:pointer}
.attachment-plus[aria-disabled=true]{opacity:.45;pointer-events:none}
.attachment-plus:focus-visible{outline:2px solid #6ed5ff;outline-offset:2px}
#pendingFiles{min-width:0;max-height:96px;overflow:auto;flex:1}
.input-shell.drag-over{border-color:#edc575;box-shadow:0 0 0 2px #edc57555;position:relative}
.input-shell.drag-over:after{content:'Dépose les fichiers ou un dossier ici';position:absolute;inset:0;display:grid;place-items:center;border-radius:15px;background:#102438ed;color:#ffe3a7;pointer-events:none;text-align:center;padding:12px}
@media(max-width:560px){.hero.scene-banner{height:auto;aspect-ratio:1672/941}.compose-shell .chatbar{grid-template-columns:minmax(0,1fr) 116px}.compose-actions .current-conversation select{font-size:10px}.compose-actions .conversation-controls .btn{font-size:9px;padding:4px}.compose-actions #chatStatus{font-size:9px}.compose-shell #chatInput{min-height:150px}}

#pendingFiles .file-chip{overflow-wrap:anywhere;max-width:100%;font-size:11px}#pendingFiles .file-chip .btn{padding:3px 6px;font-size:10px}

/* User-approved wide responses and attachment control before the response mode. */
#page-chat .msg.ai{width:100%;max-width:100%;justify-self:stretch;min-width:0;box-sizing:border-box}
#page-chat .msg.ai.has-media{width:100%;max-width:100%}
.response-copy{min-width:0;max-width:100%}
.input-settings .attachment-plus{display:grid;place-items:center;flex:none;width:28px;height:28px;min-width:28px;padding:0;margin:0;border-radius:8px;font-size:21px;line-height:1;cursor:pointer}
.input-settings #chatMode{min-width:0;max-width:calc(100% - 108px)}
@media(max-width:560px){.input-settings{gap:5px}.input-settings #chatMode{max-width:calc(100% - 50px)}.input-settings .attachment-plus{width:26px;height:26px;min-width:26px}}

#page-chat .conversation-space{background:linear-gradient(rgba(5,15,26,.70),rgba(5,15,26,.82)),url('/static/chat-wallpaper.png') center 38%/cover no-repeat}
#page-chat .msg.ai{background:rgba(9,25,42,.91)}
#page-chat .msg.user{background:rgba(28,65,87,.94)}

/* Plain, readable assistant prose; file and image controls retain their own cards. */
#page-chat .msg.ai,#page-chat .msg.ai.has-media{border:0;background:transparent;box-shadow:none;border-radius:0;padding:8px 12px;width:100%;max-width:100%}
#page-chat .response-copy{white-space:normal;line-height:1.75;overflow-wrap:anywhere;color:#e8f1fa}
.response-copy p{margin:0 0 14px}.response-copy p:last-child{margin-bottom:0}
#page-chat .response-copy h3{font-size:16px;margin:20px 0 10px;font-weight:650}
.response-copy strong{font-weight:650;color:#f5f9ff}
.response-copy p code,.response-copy h3 code{padding:2px 5px;border-radius:4px;background:#233344;color:#edf8ff;font:0.9em/1.5 Consolas,monospace}
.response-copy .revealing-text{white-space:pre-wrap!important}
#page-chat .conversation-space{background:linear-gradient(rgba(5,15,26,.85),rgba(5,15,26,.90)),url('/static/chat-wallpaper.png') center 38%/cover no-repeat}

/* Wallpaper on secondary pages; dashboard and conversation keep their own themes. */
.main:has(>.page:not(.hidden):not(#page-home):not(#page-chat)){background:linear-gradient(rgba(5,15,26,.78),rgba(5,15,26,.88)),url('/static/chat-wallpaper.png') center 38%/cover fixed no-repeat;min-height:100dvh}

.user-view #page-home .grid,.user-view #page-home .compute-panel{display:none}

/* Compact file cards follow the label; opened code gets the conversation width. */
#page-chat .code-file,#page-chat .attachment-card{width:fit-content;max-width:100%;box-sizing:border-box}
#page-chat .code-file .artifact-info,#page-chat .attachment-card .artifact-info{flex:0 1 auto}
#page-chat .code-file .artifact-info strong,#page-chat .attachment-card .artifact-info strong{max-width:52ch;overflow-wrap:anywhere}
#page-chat .code-file .code-artifact>summary{padding:8px 10px;gap:8px}
#page-chat .code-file .artifact-icon,#page-chat .attachment-card .artifact-icon{width:27px;height:27px;font-size:11px;border-radius:7px}
#page-chat .code-file .artifact-disclosure{margin-left:10px}
#page-chat .code-file .artifact-actions{padding:0 10px 8px;gap:6px}
#page-chat .code-file .artifact-actions .btn{min-height:26px;padding:5px 8px}
#page-chat .code-file:has(.code-artifact[open]){width:100%}
#page-chat .code-file:has(.code-artifact[open]) .artifact-info{flex:1}
#page-chat .attachment-card{padding:8px 10px;gap:8px}
#page-chat .attachment-card .btn{padding:6px 8px;font-size:11px}
#pendingFiles{display:flex;flex-wrap:wrap;gap:6px}#pendingFiles .file-chip{width:fit-content;max-width:100%;box-sizing:border-box;margin:0;padding:6px 8px}
