/* Hide account JID on login "Administrated by" list — show name only */
#login_widget ul.list.middle li .second {
  display: none !important;
}

/*
 * iOS PWA: TOP safe area via body top inset.
 * Movim main/nav are position:absolute;top:0 — body padding-top does NOT
 * push them (they still draw under the Dynamic Island). Use top+bottom:0
 * so the body box starts below the notch and still flushes to screen bottom.
 */
html {
  height: 100%;
  background: rgb(238, 238, 238);
}

@media (prefers-color-scheme: dark) {
  html { background: rgb(25, 32, 40); }
}

html:has(body.nightmode) {
  background: rgb(25, 32, 40);
}

body {
  top: var(--saa-top, env(safe-area-inset-top, 0px)) !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: auto !important;
  position: absolute !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

@media (display-mode: standalone) {
  body {
    /* Cold-start: env() can be 0 before WebKit settles — keep ≥50px top. */
    top: var(--saa-top, max(env(safe-area-inset-top, 0px), 50px)) !important;
  }
}

/*
 * Chat: clean bottom home-indicator band (solid fill, no UI leaking in).
 */
#chat_widget .chat_box {
  padding-bottom: env(safe-area-inset-bottom, 0px) !important;
  background-color: rgb(var(--movim-background)) !important;
}

#chat_widget::after {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: env(safe-area-inset-bottom, 0px);
  background-color: rgb(var(--movim-background));
  pointer-events: none;
  z-index: 8;
}

/* ---- Chat message text: +2 size steps (1.75rem → 2.25rem) ---- */
#chat_widget ul.list li > div.bubble {
  font-size: 2.25rem !important;
}

#chat_widget ul.list li > div.bubble:not(.file),
#chat_widget ul.list li > div.bubble.file div.audio_player {
  line-height: 3.25rem !important;
}

#chat_widget ul.list li > div.bubble > div > p {
  font-size: 2.25rem !important;
}

/* ---- OMEMO lock relocated to chat header (center) ---- */
#chat_widget .chat_box form span.control.icon.encrypted,
#chat_widget .chat_box form span.control.icon.encrypted_disabled,
#chat_widget .chat_box form span.control.icon.encrypted_loading {
  display: none !important;
}

/*
 * Keep the original lock-sized blank slot beside the textarea. This prevents
 * long text from exceeding the composer after the real lock moves upstairs.
 */
#chat_widget .chat_box form textarea[data-encryptedstate] {
  width: calc(100% - 6.5rem) !important;
}
#chat_widget .chat_box ul.list > li.main.edit form textarea[data-encryptedstate] {
  width: calc(100% - 9.5rem) !important;
}
#movim-omemo-compose-spacer {
  position: absolute;
  right: 0;
  top: 0;
  display: block;
  width: 5rem;
  height: 6rem;
  pointer-events: none;
  visibility: hidden;
}

/* Larger, easier-to-hit send target. */
#chat_widget .chat_box > ul.list > li.main > span.send.control.icon {
  flex: 0 0 6rem !important;
  width: 6rem !important;
  min-width: 6rem !important;
  height: 6rem !important;
  line-height: 6rem !important;
  font-size: 4rem !important;
  margin: 0 !important;
  text-align: center;
  touch-action: manipulation;
}
#chat_widget .chat_box > ul.list > li.main > span.send.control.icon > a {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}

#chat_widget > header ul.list.middle > li {
  position: relative;
}

#movim-omemo-header-lock {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}

#movim-omemo-header-lock > span.control.icon {
  position: static !important;
  display: none !important;
  height: 5rem !important;
  line-height: 5rem !important;
  width: 5rem !important;
  padding: 0 !important;
  margin: 0 !important;
  font-size: 2.75rem !important;
  text-align: center;
  color: rgba(var(--movim-font), 0.75);
  cursor: pointer;
  flex: none !important;
  right: auto !important;
  top: auto !important;
}

#chat_widget:has(textarea[data-encryptedstate="yes"]) #movim-omemo-header-lock > span.encrypted {
  display: inline-block !important;
}
#chat_widget:has(textarea[data-encryptedstate="disabled"]) #movim-omemo-header-lock > span.encrypted_disabled {
  display: inline-block !important;
}
#chat_widget:has(textarea[data-encryptedstate="build"]) #movim-omemo-header-lock > span.encrypted_loading {
  display: inline-block !important;
  opacity: 0.55;
}

#movim-omemo-header-lock > span.control.icon:active {
  font-variation-settings: "FILL" 1;
}
