/* Minimal two-row desktop composer, inspired by owner's reference layout, original SAVA controls intact. */
@media(min-width:721px){
 #root #chatView .composer.sava-reference-desktop{
  display:grid!important;grid-template-columns:minmax(0,1fr)!important;
  grid-auto-rows:auto!important;gap:0!important;min-height:75px!important;
  padding:12px 13px 8px!important;border-radius:25px!important;
  border:1px solid #e4e9e5!important;box-shadow:0 3px 16px rgba(25,53,34,.055)!important;
  overflow:visible!important;
 }
 #root #chatView .composer.sava-reference-desktop #prompt{
  grid-column:1;grid-row:1;display:block!important;box-sizing:border-box;
  width:100%!important;min-height:30px!important;max-height:180px!important;
  padding:4px 6px 9px!important;margin:0!important;
  font-size:15px!important;line-height:1.5!important;
  background:transparent!important;border:0!important;box-shadow:none!important;outline:0!important;resize:none;
 }
 #root #chatView .composer.sava-reference-desktop #savaFilePick{display:none!important}
 #root #chatView .composer.sava-reference-desktop #savaReferenceBottom{
  grid-row:3;display:flex!important;align-items:center;gap:7px;min-height:39px;
  width:100%;position:relative;
 }
 #root #chatView .composer.sava-reference-desktop #savaReferencePlus{
  display:grid;place-items:center;flex:0 0 36px;width:36px;height:36px;
  border:0;border-radius:50%;background:transparent;color:#222;font:400 28px/1 system-ui;
  padding:0;cursor:pointer
 }
 #root #chatView .composer.sava-reference-desktop #savaReferencePlus:hover{background:#f2f4f2}
 #root #chatView .composer.sava-reference-desktop #savaReferenceBottom #savaWebModelButton{
  margin-left:auto!important;margin-right:0!important;min-width:0!important;width:auto!important;
  height:35px!important;padding:0 10px!important;font:400 12px/1 system-ui!important;
  color:#87918b!important;background:transparent!important;border:0!important;box-shadow:none!important;
  white-space:nowrap!important;border-radius:10px!important
 }
 #root #chatView .composer.sava-reference-desktop #savaReferenceBottom #savaWebModelButton:hover{background:#f5f6f5!important;color:#57645c!important}
 #root #chatView .composer.sava-reference-desktop #savaReferenceMic{
  flex:0 0 34px;display:grid;place-items:center;width:34px;height:34px;
  margin:0;padding:0;border:0;border-radius:50%;background:transparent;color:#343e37;cursor:pointer
 }
 #root #chatView .composer.sava-reference-desktop #savaReferenceMic:hover{background:#f1f4f2}
 #root #chatView .composer.sava-reference-desktop #send{
  margin:0!important;flex:none!important;width:38px!important;min-width:38px!important;
  height:38px!important;min-height:38px!important;border-radius:50%!important;
  box-shadow:none!important;background:#169856!important;border:0!important;
 }
 #root #chatView .composer.sava-reference-desktop .sava-v4-mic{
  flex:0 0 35px!important;min-width:35px!important;width:35px!important;height:35px!important;
  min-height:35px!important;background:transparent!important;box-shadow:none!important;
  border:0!important;border-radius:50%!important;color:#282e2a!important
 }
 #root #chatView .composer.sava-reference-desktop .sava-v4-mic:hover{background:#f3f5f3!important}
 #root #chatView .composer.sava-reference-desktop #savaReferenceChip:not([hidden]){
  grid-row:2;display:flex;align-items:center;gap:7px;margin:2px 0 7px;min-width:0
 }
 #root #chatView .composer.sava-reference-desktop .sava-reference-card{
  display:flex;align-items:center;gap:8px;max-width:min(240px,70vw);min-height:56px;
  padding:5px 8px 5px 5px;border:1px solid #e1e8e3;border-radius:13px;
  color:#3d4b41;background:#f9fbfa;font:500 12px/1.3 system-ui;text-align:left;cursor:pointer
 }
 #root #chatView .composer.sava-reference-desktop .sava-reference-card img{
  width:47px;height:47px;object-fit:cover;border-radius:9px
 }
 #root #chatView .composer.sava-reference-desktop .sava-reference-card>span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 #root #chatView .composer.sava-reference-desktop .sava-reference-file-symbol{
  display:grid;place-items:center;width:45px;height:45px;border-radius:9px;background:#eaf1ed;color:#397d5c;font-size:24px
 }
 #root #chatView .composer.sava-reference-desktop .sava-reference-chip-remove{
  border:0;background:#edf1ed;color:#4b5c50;border-radius:50%;width:23px;height:23px;cursor:pointer
 }
 #root #chatView .composer.sava-reference-desktop #savaReferenceAttachMenu{
  display:flex;flex-direction:column;position:absolute;bottom:calc(100% + 10px);
  left:0;min-width:205px;padding:7px;border:1px solid #e0e8e1;border-radius:15px;
  background:#fff;box-shadow:0 12px 34px #1b37262b;z-index:3000;gap:2px
 }
 #root #chatView .composer.sava-reference-desktop #savaReferenceAttachMenu[hidden]{display:none!important}
 #root #chatView .composer.sava-reference-desktop #savaReferenceAttachMenu button{
  width:100%;border:0;border-radius:9px;background:transparent;text-align:left;
  padding:11px;color:#263d2f;font:500 13px/1.4 system-ui;cursor:pointer
 }
 #root #chatView .composer.sava-reference-desktop #savaReferenceAttachMenu button:hover{background:#f1f6f2}
 #root #chatView .composer.sava-reference-desktop #savaWebModelMenu{
  bottom:calc(100% + 8px);left:auto;right:70px;z-index:3001
 }
 #root #chatView .composer.sava-reference-desktop #savaReferenceBottom .sava-mobile-controls{display:none!important}
}
.sava-reference-preview{position:fixed;inset:0;margin:auto;max-width:min(95vw,1040px);
 max-height:90vh;width:min(90vw,900px);padding:18px;background:#fff;color:#213b2c;
 border:1px solid #dde8df;border-radius:21px;box-shadow:0 30px 80px #10221c66}
.sava-reference-preview::backdrop{background:#10251ccc;backdrop-filter:blur(4px)}
.sava-reference-preview-close{position:absolute;right:10px;top:10px;width:36px;height:36px;
 border:0;border-radius:50%;background:#e9f0eb;color:#25382c;font-size:27px;cursor:pointer}
.sava-reference-preview-content{max-height:80vh;overflow:auto;text-align:center;padding:24px 0 0}
.sava-reference-preview-content img{max-width:100%;max-height:74vh;object-fit:contain;border-radius:9px}
.sava-reference-preview-content iframe{width:100%;height:72vh;border:0}
.sava-reference-preview-content pre{white-space:pre-wrap;text-align:left;overflow-wrap:anywhere;font:13px/1.5 system-ui}
@media(max-width:720px){
 #root #chatView .composer #savaReferenceBottom{display:none!important}
 /* Inline photo/file preview: no separate banner or invisible attachment. */
 #root #chatView .composer #savaReferenceChip[hidden]{display:none!important}
 #root #chatView .composer #savaReferenceChip:not([hidden]){
  display:flex!important;position:relative!important;align-self:flex-start!important;
  flex:0 0 auto!important;align-items:flex-start!important;
  min-height:0!important;max-width:100%!important;
  margin:8px 8px 3px!important;padding:0!important;gap:0!important
 }
 #root #chatView .composer #savaReferenceChip .sava-reference-card{
  display:flex!important;position:relative!important;align-items:center!important;
  justify-content:center!important;flex:0 0 76px!important;
  width:76px!important;height:76px!important;max-width:76px!important;
  padding:0!important;margin:0!important;overflow:hidden!important;
  border:1px solid #e2e7e3!important;border-radius:14px!important;
  background:#f4f6f4!important;box-shadow:0 1px 5px rgba(24,49,35,.12)!important;
  cursor:pointer!important
 }
 #root #chatView .composer #savaReferenceChip .sava-reference-card img{
  display:block!important;width:100%!important;height:100%!important;
  object-fit:cover!important;border-radius:13px!important
 }
 #root #chatView .composer #savaReferenceChip .sava-reference-card>span:last-child{
  display:none!important
 }
 #root #chatView .composer #savaReferenceChip .sava-reference-file-symbol{
  display:grid!important;place-items:center!important;
  width:100%!important;height:100%!important;border-radius:13px!important;
  background:#eff5f1!important;color:#34815e!important;font-size:27px!important
 }
 #root #chatView .composer #savaReferenceChip .sava-reference-chip-remove{
  display:grid!important;place-items:center!important;position:absolute!important;
  top:-7px!important;right:-7px!important;z-index:3!important;
  flex:none!important;width:27px!important;height:27px!important;
  min-width:27px!important;min-height:27px!important;
  margin:0!important;padding:0!important;border:2px solid #fff!important;
  border-radius:50%!important;background:#27332c!important;color:#fff!important;
  box-shadow:0 1px 5px rgba(0,0,0,.22)!important;
  font:600 21px/1 system-ui!important;cursor:pointer!important;
  touch-action:manipulation
 }
 #root #chatView .composer #savaReferenceChip .sava-reference-chip-remove:focus-visible{
  outline:2px solid #1b945c!important;outline-offset:2px!important
 }
 #root #chatView .composer.sava-composer-r3 #savaMobileModelButton{
  background:transparent!important;border:0!important;color:#86938b!important;
  font-weight:400!important;font-size:12px!important;box-shadow:none!important;padding:0 14px!important
 }
}

#root #chatView #savaFileBadge:not([hidden]){cursor:pointer}
#root #chatView #savaFileBadge:focus-visible{outline:2px solid #128455;outline-offset:2px}

/* One composer attachment preview: the reference chip owns the visual. */
#root #chatView:has(#savaReferenceChip) #savaFileBadge{display:none!important}
