/* LAUNCH_FIX3: iPhone standalone geometry and chat legibility corrections. */

/* Keep the floating dock visibly clear of the Home indicator. */
#blueink-r11[data-pwa-standalone] .bottom-nav {
  bottom:calc(env(safe-area-inset-bottom,0px) + 18px);
}

/* Header controls start just below the status safe area, without a second tall slot. */
#blueink-r11 .topbar:not(.home-header) {
  height:calc(60px + var(--top-safe));
  padding:calc(8px + var(--top-safe)) var(--page-pad) 8px;
}
#blueink-r11 .round8-topbar {
  min-height:calc(54px + var(--top-safe));
  height:auto;
  padding:calc(6px + var(--top-safe)) 10px 6px 14px;
}
#blueink-r11 .chat-header.r12-chat-header:has(.conversation-actions) {
  min-height:calc(50px + var(--top-safe));
  height:calc(50px + var(--top-safe));
  padding:calc(8px + var(--top-safe)) 10px 8px 14px;
}
#blueink-r11 .chat-stationery-decor {
  inset:calc(50px + var(--top-safe)) 0 0;
}

/* iOS focuses form controls without page zoom only when their computed size is 16px+. */
#blueink-r11 :is(input,textarea,select) {
  font-size:16px!important;
}

/* The chat composer stays above the Home indicator and fully masks scrolled text. */
#blueink-r11[data-pwa-standalone] .r12-composer {
  margin-bottom:calc(18px + env(safe-area-inset-bottom,0px));
}
#blueink-r11[data-pwa-standalone] .r12-composer::after {
  height:calc(18px + env(safe-area-inset-bottom,0px));
}
#blueink-r11 .r12-composer::before {
  height:calc(100% + 18px);
  background:var(--bg);
}
#blueink-r11 .r12-composer .compose-tools {
  align-items:flex-end;
  min-height:36px;
  height:auto;
}
#blueink-r11 .r12-composer .native-media-tools {
  align-self:stretch;
}
#blueink-r11 .r12-composer .daily-media {
  display:grid;
  grid-template-rows:auto auto auto;
  min-width:0;
}
#blueink-r11 .r12-composer .daily-media-preview {
  grid-row:1;
  min-width:0;
  padding:2px 0 6px;
}
#blueink-r11 .r12-composer .daily-media-status {
  grid-row:2;
}
#blueink-r11 .r12-composer .daily-media-toolbar {
  grid-row:3;
}
#blueink-r11 .r12-composer .daily-media-file-preview {
  width:100%;
  max-width:100%;
  flex-wrap:nowrap;
}
#blueink-r11 .r12-composer .daily-media-preview-file-name {
  min-width:0;
  max-width:none;
  flex:1;
}

/* Message columns own the available width so short user messages do not collapse. */
#blueink-r11 .r12-message-list .bubble-stack {
  width:100%;
  min-width:0;
}
#blueink-r11 .r12-message-list .bubble {
  width:fit-content;
  max-width:min(72%,272px);
  overflow-wrap:break-word;
  word-break:normal;
}
#blueink-r11 .r12-message-list .msg .avatar {
  align-self:start;
}
#blueink-r11 .r12-message-list :is(.bubble-group-lone,.bubble-group-top) .avatar {
  visibility:visible;
}
#blueink-r11 .r12-message-list :is(.bubble-group-middle,.bubble-group-bottom) .avatar {
  visibility:hidden;
}
#blueink-r11 .r12-message-list [data-group-tail="1"] {
  margin-bottom:24px;
}
#blueink-r11 .r12-message-list [data-group-tail="1"] .bubble:last-child {
  margin-bottom:0;
}

@media(max-width:370px) {
  #blueink-r11 .r12-message-list .bubble { max-width:min(76%,252px); }
}
