/* Scoped to the image workbench; desktop and chat retain their own layout. */
@media (max-width:1100px) {
  .image-page .workspace { display:flex; flex-direction:column; gap:16px; padding:16px; }
  .image-page .main-content,.image-page .composer,.image-page .results { min-width:0; }
  .image-page .composer,.image-page .results { min-height:0; }
  .image-page .result-body { min-height:0; }
  .image-page .gallery { max-height:none; }
  .image-page .empty-state { min-height:260px; }
  .image-page .modal-backdrop { overflow:auto; padding:12px; }
  .image-page .modal { max-height:calc(100dvh - 24px); overflow-y:auto; overscroll-behavior:contain; }
  .image-page .connection-test { display:flex; align-items:center; gap:8px; margin:16px 0; font-size:14px; overflow-wrap:anywhere; }
}
@media (max-width:760px) {
  .image-page .sidebar { width:100%; height:auto; min-height:64px; padding:12px; flex-wrap:wrap; gap:10px; }
  .image-page .brand { margin:0; gap:8px; }
  .image-page .brand>div:last-child { display:block; }
  .image-page .brand strong { font-size:17px; }
  .image-page .brand span { display:none; }
  .image-page .brand-mark { width:34px; height:34px; }
  .image-page .side-bottom { margin:0; padding:0; gap:4px; }
  .image-page .settings-link { width:auto; padding:10px 8px; font-size:13px; white-space:nowrap; min-height:44px; }
  .image-page .settings-link span { font-size:17px; margin-right:5px; }
  .image-page .sidebar nav { order:3; width:100%; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; margin:0; }
  .image-page .sidebar nav .nav-item { display:flex; justify-content:center; align-items:center; width:100%; min-height:44px; padding:8px 4px; font-size:13px; white-space:nowrap; }
  .image-page .sidebar nav .nav-item span { display:none; }
  .image-page .topbar { height:48px; min-height:48px; padding:0 14px; }
  .image-page .crumb { font-size:13px; }
  .image-page .crumb strong { font-size:16px; }
  .image-page .workspace { padding:10px 10px max(16px,env(safe-area-inset-bottom)); gap:12px; }
  .image-page .panel { padding:16px; }
  .image-page .mode-tabs { margin:-16px -16px 16px; padding:0 10px; }
  .image-page .mode { flex:1; font-size:15px; min-height:50px; padding:14px 8px; }
  .image-page .field-label { font-size:14px; }
  .image-page textarea,.image-page select,.image-page input { font-size:16px; max-width:100%; }
  .image-page textarea { min-height:132px; }
  .image-page select,.image-page .text-input,.image-page .custom-size,.image-page .advanced-panel input { min-height:44px; }
  .image-page .option-grid { grid-template-columns:minmax(0,1fr); gap:4px; }
  .image-page .option-grid>div { min-width:0; }
  .image-page .ratio-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .image-page .ratio { min-height:60px; padding:10px 4px; }
  .image-page .ratio b { font-size:15px; }
  .image-page .ratio small { font-size:12px; }
  .image-page .advanced-row { display:grid; grid-template-columns:auto minmax(0,1fr); gap:8px 12px; }
  .image-page #sizeLabel { text-align:right; font-size:13px; }
  .image-page .advanced-btn { grid-column:1/-1; justify-self:end; margin:0; padding:8px 0 8px 12px; min-height:44px; }
  .image-page .advanced-panel { gap:10px; }
  .image-page .advanced-panel label { min-width:0; font-size:13px; }
  .image-page .generate-btn { height:52px; font-size:17px; margin-top:14px; }
  .image-page .upload-zone { min-height:130px; padding:16px 8px; }
  .image-page .upload-zone b { font-size:15px; }
  .image-page .upload-zone small { font-size:12px; }
  .image-page .preview-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; padding:4px; }
  .image-page .preview-item { min-width:0; }
  .image-page .preview-grid img { width:100%; height:100%; }
  .image-page .remove-preview { width:32px; height:32px; font-size:22px; line-height:26px; right:-5px; top:-5px; }
  .image-page .results-head { padding:16px 14px; gap:10px; }
  .image-page .results-head h2 { font-size:18px; }
  .image-page .results-head p { font-size:12px; }
  .image-page .done-tag { flex-shrink:0; font-size:11px; }
  .image-page .result-body { display:flex; flex-direction:column; }
  .image-page .gallery { padding:10px; overflow:visible; }
  .image-page .result-card { min-height:0; }
  .image-page .result-card img { width:100%; height:auto; max-height:none; object-fit:contain; }
  .image-page .download { width:44px; height:44px; font-size:21px; }
  .image-page .history-rail { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; padding:14px; border-left:0; overflow:visible; }
  .image-page .rail-title { grid-column:1/-1; font-size:14px; margin-bottom:0; }
  .image-page .history-thumb { display:block; width:100%; height:auto; aspect-ratio:1; margin:0; background-size:contain; background-repeat:no-repeat; background-color:#ffffff55; }
  .image-page .history-thumb:after { display:none; }
  .image-page .modal { padding:20px 16px; width:100%; }
  .image-page .modal h2 { font-size:23px; }
  .image-page .modal-head { gap:10px; }
  .image-page .close-btn { width:44px; height:44px; flex-shrink:0; }
  .image-page .modal-actions { margin-top:14px; flex-wrap:wrap; }
  .image-page .modal-actions button { min-height:46px; font-size:14px; }
  .image-page .reveal { height:44px; top:0; right:8px; font-size:14px; }
  .image-page .error-entry time { float:none; display:block; margin-top:6px; }
  .image-page .error-entry p { overflow-wrap:anywhere; }
  .image-page .privacy-note { line-height:1.6; }
}
