/* Telegram-reference composers. The outer row has two items: + and a flexible
   field. GIF/input/send live inside the field; no outer grid reserves tracks. */
:root{
  --iris-composer-height:56px;
  --iris-composer-gap:8px;
  --iris-composer-border:color-mix(in srgb,var(--iris-line,#e6e1e9) 84%,var(--iris-text,#211e25) 16%);
  --iris-composer-glass:color-mix(in srgb,var(--iris-surface,#fff) 84%,transparent);
  --iris-composer-placeholder:var(--iris-muted,#817a87);
}

body.iris-chat-open #app .conversation-screen .message-compose,
body.iris-chat-open #app .group-chat-screen:not(.channel-discussion-screen) .group-message-compose,
body #app .group-chat-screen.channel-discussion-screen .channel-discussion-compose,
html body #app .thread-comment-form .thread-comment-composer,
html body #app .post-comments .comment-form,
body #app .icu-thread .icu-composer{
  box-sizing:border-box!important;
  display:flex!important;
  grid-template-columns:none!important;
  align-items:flex-end!important;
  gap:var(--iris-composer-gap)!important;
  min-width:0!important;
  height:auto!important;
  min-height:var(--iris-composer-height)!important;
  padding:4px 0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
}

/* Chats already resize their screen with the native keyboard. Keep the row
   in that screen's flow instead of applying a second keyboard offset. */
body.iris-chat-open #app .conversation-screen .message-compose,
body.iris-chat-open #app .group-chat-screen:not(.channel-discussion-screen) .group-message-compose{
  position:relative!important;
  inset:auto!important;
  width:calc(100% - 28px)!important;
  max-width:680px!important;
  margin:0 14px max(8px,env(safe-area-inset-bottom))!important;
  flex:0 0 auto!important;
  transform:none!important;
}
body.iris-chat-open #app .conversation-screen .message-compose:focus-within,
body.iris-chat-open #app .group-chat-screen:not(.channel-discussion-screen) .group-message-compose:focus-within{
  margin-bottom:4px!important;
}
body #app .group-chat-screen.channel-discussion-screen .channel-discussion-compose{
  position:fixed!important;
  left:14px!important;
  right:14px!important;
  width:auto!important;
  margin:0!important;
  bottom:var(--iris-discussion-keyboard-height,0px)!important;
  transform:none!important;
  z-index:40!important;
  transition:bottom .16s ease-out!important;
}
body #app .group-chat-screen.channel-discussion-screen .channel-discussion-compose:not(.keyboard-open){
  bottom:max(8px,env(safe-area-inset-bottom))!important;
}
body #app .group-chat-screen.channel-discussion-screen .channel-discussion-compose.keyboard-open{
  padding-bottom:4px!important;
}

html body #app .thread-comment-form{
  box-sizing:border-box!important;
  position:fixed!important;
  inset:auto 0 var(--iris-comment-keyboard-height,0px)!important;
  width:100%!important;
  margin:0!important;
  padding:8px 14px max(8px,env(safe-area-inset-bottom))!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
}
html body #app .thread-comment-form .thread-comment-composer{
  width:100%!important;
  margin:0!important;
}
html[data-iris-native-interactions] body.iris-post-thread-open #app .thread-comment-form{
  position:relative!important;
  inset:auto!important;
  bottom:auto!important;
  z-index:4!important;
}
html[data-iris-native-interactions] body.iris-post-thread-open.iris-comment-keyboard-open #app .thread-comment-form{
  padding-bottom:8px!important;
}
html body #app .post-comments .comment-form{
  position:relative!important;
  inset:auto!important;
  width:100%!important;
  margin:12px 0 0!important;
}

body #app .icu-thread .icu-composer{
  position:fixed!important;
  left:14px!important;
  right:14px!important;
  bottom:calc(var(--icu-keyboard-height,0px) + max(8px,env(safe-area-inset-bottom)))!important;
  width:auto!important;
  margin:0!important;
  transform:none!important;
  z-index:40!important;
}
body #app .icu-thread .icu-composer.icu-keyboard-open{
  bottom:var(--icu-keyboard-height,0px)!important;
  padding-bottom:4px!important;
}

/* The pill fills all space left by +. Its controls have fixed flex bases and
   only the text input grows or shrinks. Hidden controls consume no space. */
html body #app .iris-composer-field{
  box-sizing:border-box!important;
  display:flex!important;
  grid-template-columns:none!important;
  flex:1 1 0%!important;
  align-items:flex-end!important;
  gap:4px!important;
  width:auto!important;
  min-width:0!important;
  min-height:50px!important;
  margin:0!important;
  padding:3px 6px!important;
  border:1px solid var(--iris-composer-border)!important;
  border-radius:26px!important;
  background:var(--iris-composer-glass)!important;
  box-shadow:0 5px 18px color-mix(in srgb,var(--iris-text,#211e25) 9%,transparent),inset 0 1px 0 color-mix(in srgb,#fff 48%,transparent)!important;
  backdrop-filter:blur(24px) saturate(1.18)!important;
  -webkit-backdrop-filter:blur(24px) saturate(1.18)!important;
}
html body #app .iris-composer-plus,
html body #app .icu-thread .icu-compose-round{
  box-sizing:border-box!important;
  display:grid!important;
  place-items:center!important;
  flex:0 0 44px!important;
  width:44px!important;
  min-width:44px!important;
  max-width:44px!important;
  height:44px!important;
  min-height:44px!important;
  margin:0 0 3px!important;
  padding:0!important;
  border:1px solid var(--iris-composer-border)!important;
  border-radius:50%!important;
  background:var(--iris-composer-glass)!important;
  color:var(--iris-text,#211e25)!important;
  font:inherit!important;
  font-size:30px!important;
  font-weight:350!important;
  line-height:1!important;
  box-shadow:0 4px 14px color-mix(in srgb,var(--iris-text,#211e25) 8%,transparent)!important;
}
html body #app .iris-composer-plus:disabled{opacity:.45!important}

html body #app .iris-composer-field :is(textarea,input),
body.iris-chat-open #app .conversation-screen .message-compose .iris-composer-field textarea,
body.iris-chat-open #app .group-chat-screen:not(.channel-discussion-screen) .group-message-compose .iris-composer-field textarea,
body #app .group-chat-screen.channel-discussion-screen .channel-discussion-compose .iris-composer-field textarea{
  box-sizing:border-box!important;
  flex:1 1 0%!important;
  width:0!important;
  min-width:0!important;
  min-height:44px!important;
  height:var(--iris-composer-input-height,44px)!important;
  max-height:112px!important;
  margin:0!important;
  padding:11px 6px!important;
  border:0!important;
  border-radius:0!important;
  outline:0!important;
  background:transparent!important;
  color:var(--iris-text,#211e25)!important;
  font:inherit!important;
  font-size:16px!important;
  line-height:22px!important;
  resize:none!important;
  box-shadow:none!important;
}
html body #app .iris-composer-field :is(textarea,input)::placeholder{
  color:var(--iris-composer-placeholder)!important;
  opacity:.84!important;
}
/* Keep the introduction hint on one line; written messages still wrap normally. */
html body #app .iris-composer-field textarea[placeholder="Write your request message…"]:placeholder-shown::placeholder{
  font-size:clamp(10.8px,calc(5.714vw - 8.8px),16px)!important;
  white-space:nowrap!important;
}
@media(max-width:360px){
  html body #app .message-compose:has(textarea[placeholder="Write your request message…"]:placeholder-shown) .iris-composer-plus{
    flex-basis:36px!important;width:36px!important;min-width:36px!important;max-width:36px!important;
  }
  html body #app .iris-composer-field:has(textarea[placeholder="Write your request message…"]:placeholder-shown){gap:2px!important}
  html body #app .iris-composer-field:has(textarea[placeholder="Write your request message…"]:placeholder-shown) .iris-gif-button{
    flex-basis:24px!important;width:24px!important;min-width:24px!important;max-width:24px!important;
  }
}
html body #app .iris-composer-field :is(.iris-gif-button,.icu-gif-round,.icu-bell-round,.icu-compose-mode),
body.iris-chat-open #app .conversation-screen .iris-composer-field .message-gif-button,
body.iris-chat-open #app .group-chat-screen:not(.channel-discussion-screen) .iris-composer-field .group-message-gif-button{
  box-sizing:border-box!important;
  display:grid!important;
  place-items:center!important;
  flex:0 0 36px!important;
  width:36px!important;
  min-width:36px!important;
  max-width:36px!important;
  height:44px!important;
  min-height:44px!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  border-radius:50%!important;
  background:transparent!important;
  color:var(--iris-muted,#817a87)!important;
  font:inherit!important;
  font-size:11px!important;
  font-weight:750!important;
  line-height:1!important;
  box-shadow:none!important;
}
html body #app .iris-composer-field [hidden],
html body #app :is(.message-compose,.group-message-compose,.thread-comment-composer,.comment-form,.icu-composer)[hidden]{
  display:none!important;
}
html body #app .icu-thread .iris-composer-field .icu-bell-round svg{
  width:21px!important;
  height:21px!important;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
}
html body #app .iris-composer-field :is(.primary,.group-send,.thread-comment-send,.quiet,.icu-send),
body.iris-chat-open #app .conversation-screen .message-compose .iris-composer-field .primary,
body.iris-chat-open #app .group-chat-screen:not(.channel-discussion-screen) .group-message-compose .iris-composer-field .group-send{
  box-sizing:border-box!important;
  display:grid!important;
  place-items:center!important;
  flex:0 0 44px!important;
  width:44px!important;
  min-width:44px!important;
  max-width:44px!important;
  height:44px!important;
  min-height:44px!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  border-radius:50%!important;
  background:var(--iris-accent,#7052e7)!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  font:inherit!important;
  font-size:24px!important;
  line-height:1!important;
  box-shadow:none!important;
}

/* Photos stay queued beside the text field until a successful send or removal. */
html body #app :is(.iris-attachment-preview,.icu-channel-media-preview):empty{display:none!important}
html body #app :is(.iris-attachment-preview,.icu-channel-media-preview):not(:empty){
  position:absolute!important;
  left:52px!important;
  bottom:calc(100% + 8px)!important;
  z-index:3!important;
  display:flex!important;
  gap:8px!important;
  max-width:calc(100% - 60px)!important;
  padding:0!important;
  border:0!important;
  background:transparent!important;
}
html body #app .iris-attachment-item{position:relative!important;width:76px!important;height:76px!important}
html body #app .iris-attachment-item img{display:block!important;width:76px!important;height:76px!important;object-fit:cover!important;border:1px solid var(--iris-composer-border)!important;border-radius:14px!important}
html body #app .iris-attachment-remove{
  position:absolute!important;
  top:-5px!important;
  right:-5px!important;
  display:grid!important;
  place-items:center!important;
  width:24px!important;
  min-width:24px!important;
  height:24px!important;
  min-height:24px!important;
  margin:0!important;
  padding:0!important;
  border:1px solid var(--iris-composer-border)!important;
  border-radius:50%!important;
  background:var(--iris-surface,#fff)!important;
  color:var(--iris-text,#211e25)!important;
  font:inherit!important;
  font-size:18px!important;
  line-height:1!important;
}
html body #app .thread-comment-preview{position:relative!important;display:flex!important;margin:0 0 8px 52px!important;padding:0!important;width:76px!important;min-height:0!important}
html body #app .thread-comment-preview:empty{display:none!important}
html body #app .thread-comment-preview img{width:76px!important;height:76px!important;object-fit:cover!important;border-radius:14px!important}
html body #app .thread-comment-preview .iris-attachment-remove{left:auto!important}

/* Attachment sheet: large, clearly labeled Gallery and Camera choices. */
.iris-composer-media-sheet .icu-sheet{box-sizing:border-box;width:min(100%,520px);padding:14px 18px calc(22px + env(safe-area-inset-bottom));border-radius:28px 28px 0 0;background:color-mix(in srgb,var(--iris-surface,#fff) 94%,transparent);backdrop-filter:blur(28px);-webkit-backdrop-filter:blur(28px)}
.iris-composer-media-sheet .icu-grabber{width:36px;height:5px;margin:0 auto 18px;border-radius:999px;background:var(--iris-muted,#817a87);opacity:.45}
.iris-composer-media-sheet h3{margin:0 0 18px;font-size:18px}
.iris-composer-media-sheet .icu-channel-media-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.iris-composer-media-sheet .icu-channel-media-choice{min-height:106px;padding:16px 10px;border-radius:20px;font-size:15px}
.iris-composer-media-sheet .icu-channel-media-icon{width:46px;height:46px}
.iris-composer-media-sheet .icu-channel-media-icon svg{width:25px;height:25px}

@media(max-width:360px){
  :root{--iris-composer-gap:6px}
  html body #app .iris-composer-plus,
  html body #app .icu-thread .icu-compose-round{flex-basis:40px!important;width:40px!important;min-width:40px!important;max-width:40px!important;height:44px!important}
  html body #app .iris-composer-field{gap:3px!important;padding-inline:4px!important}
  html body #app .iris-composer-field :is(.iris-gif-button,.icu-gif-round,.icu-bell-round,.icu-compose-mode){flex-basis:32px!important;width:32px!important;min-width:32px!important;max-width:32px!important}
  html body #app .iris-composer-field :is(.primary,.group-send,.thread-comment-send,.quiet,.icu-send){flex-basis:40px!important;width:40px!important;min-width:40px!important;max-width:40px!important;height:44px!important}
  html body #app .icu-thread .iris-composer-field .icu-compose-input{font-size:15px!important;padding-inline:4px!important}
}
@media(min-width:720px){
  body #app .icu-thread .icu-composer,
  body #app .group-chat-screen.channel-discussion-screen .channel-discussion-compose{left:50%!important;right:auto!important;width:680px!important;transform:translateX(-50%)!important}
  body.iris-chat-open #app .conversation-screen .message-compose,
  body.iris-chat-open #app .group-chat-screen:not(.channel-discussion-screen) .group-message-compose{margin-inline:auto!important}
}


/* Reply composer layout v1 — preview is a compact row above the unchanged composer. */
body.iris-chat-open #app .conversation-screen .message-compose.has-reply,
body.iris-chat-open #app .group-chat-screen:not(.channel-discussion-screen) .group-message-compose.has-reply{
  flex-wrap:wrap!important;
  align-content:flex-end!important;
  row-gap:6px!important;
  column-gap:var(--iris-composer-gap)!important;
  overflow:visible!important;
}
body.iris-chat-open #app .conversation-screen .message-compose.has-reply .iris-message-reply-draft,
body.iris-chat-open #app .group-chat-screen:not(.channel-discussion-screen) .group-message-compose.has-reply .iris-message-reply-draft{
  box-sizing:border-box!important;
  order:-1!important;
  flex:0 0 100%!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  min-height:48px!important;
  max-height:54px!important;
  margin:0!important;
  padding:7px 10px!important;
  overflow:hidden!important;
}
body.iris-chat-open #app .conversation-screen .message-compose.has-reply .iris-composer-plus,
body.iris-chat-open #app .group-chat-screen:not(.channel-discussion-screen) .group-message-compose.has-reply .iris-composer-plus{
  flex:0 0 44px!important;
}
body.iris-chat-open #app .conversation-screen .message-compose.has-reply .iris-composer-field,
body.iris-chat-open #app .group-chat-screen:not(.channel-discussion-screen) .group-message-compose.has-reply .iris-composer-field{
  flex:1 1 calc(100% - 52px)!important;
  width:auto!important;
  min-width:0!important;
}

/* Pending message requests must hide the composer after the introduction. */
body.iris-chat-open #app .conversation-screen .message-compose[hidden]{display:none!important}
