/* MXH comments R6. Nova5 sizing on the existing Custom comment/reply/edit DOM.
 * Keep the original li/i uploader, emoji, send and voice event targets.
 * The tools participate in layout: no fixed right-hand text reservation.
 * No display override on permission, disabled, attachment or recording panels. */
body.mxh-extend-ui .comment>.comment-avatar {
  width:40px;
  height:40px;
}
body.mxh-extend-ui .comment>.comment-avatar>.comment-avatar-picture {
  width:100%;
  height:100%;
  min-width:0;
  min-height:0;
  padding:0;
  border-radius:50%;
}
body.mxh-extend-ui .comment>.comment-data,
body.mxh-extend-ui .comment>.comment-edit {
  margin-left:50px;
  min-width:0;
}
body.mxh-extend-ui .comment.reply>.comment-avatar {
  width:32px;
  height:32px;
}
body.mxh-extend-ui .comment.reply>.comment-data,
body.mxh-extend-ui .comment.reply>.comment-edit {
  margin-left:42px;
}
body.mxh-extend-ui .comment .comment-inner {
  min-width:0;
  max-width:100%;
}
body.mxh-extend-ui .comment .comment-author {
  overflow-wrap:anywhere;
}
body.mxh-extend-ui .comment .comment-replace audio {
  /* Legacy voice messages have an inline 200px minimum, wider than replies. */
  min-width:0!important;
  max-width:100%;
}
body.mxh-extend-ui .comment .comment-form {
  display:flex;
  flex-wrap:wrap;
  align-items:flex-end;
  min-width:0;
  padding:0 6px;
  border:1px solid var(--mxh-ui-line);
  border-radius:12px;
  background:var(--mxh-ui-field);
  color:var(--mxh-ui-text);
}
body.mxh-extend-ui .comment .comment-form:focus-within {
  border-color:var(--mxh-ui-accent);
}
body.mxh-extend-ui .comment .comment-form>textarea {
  flex:1 1 180px;
  min-width:0;
  width:100%;
  max-width:100%;
  min-height:40px;
  max-height:160px;
  height:40px;
  padding:9px 6px;
  border:0;
  border-radius:0;
  margin:0;
  background:transparent;
  color:inherit;
  box-shadow:none;
  font:inherit;
  font-size:16px;
  line-height:22px;
  resize:none;
}
body.mxh-extend-ui .comment .comment-form>textarea::placeholder {
  color:var(--mxh-ui-muted);
  opacity:1;
}
body.mxh-extend-ui .comment .comment-form>.x-form-tools {
  position:static;
  inset:auto;
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:2px;
  max-width:100%;
  margin:0 0 3px auto;
  padding:0;
}
body.mxh-extend-ui .comment .comment-form>.x-form-tools>li {
  /* Keep the native display:none on desktop send and inline JS hide/show. */
  float:none;
  flex:0 0 34px;
  width:34px;
  height:34px;
  margin:0;
  padding:0;
  line-height:34px;
  text-align:center;
  border-radius:50%;
}
body.mxh-extend-ui .comment .comment-form>.x-form-tools>li>i,
body.mxh-extend-ui .comment .comment-form>.x-form-tools>li>.x-uploader,
body.mxh-extend-ui .comment .comment-form>.x-form-tools>li>.x-uploader>i {
  width:100%;
  height:100%;
  margin:0;
  line-height:34px;
  font-size:20px;
  vertical-align:top;
}
body.mxh-extend-ui .comment .comment-form>.x-form-tools>.x-form-tools-attach>.x-uploader {
  position:relative;
  overflow:hidden;
}
body.mxh-extend-ui .comment .comment-form .x-form-tools-attach>.x-uploader>input[type="file"] {
  /* Native Nova5 also places its transparent chooser above the visual icon. */
  inset:0;
  width:100%;
  height:100%;
  min-width:0;
  min-height:0;
  z-index:1;
  font-size:16px;
  cursor:pointer;
}
body.mxh-extend-ui .comment .comment-form>.x-form-tools>li>i::before,
body.mxh-extend-ui .comment .comment-form>.x-form-tools>li>.x-uploader>i::before {
  vertical-align:middle;
}
/* This legacy alias was absent from the existing Nova5 line-icon map. */
body.mxh-extend-ui .comment .comment-form .x-form-tools-emoji>i.fa-smile-wink::before {
  content:"";
  display:inline-block;
  width:1em;
  height:1em;
  background:currentColor;
  mask:url("../images/svg/mxh-nova5-r2/tabler/mood-smile.svg") center/contain no-repeat;
  -webkit-mask:url("../images/svg/mxh-nova5-r2/tabler/mood-smile.svg") center/contain no-repeat;
}
body.mxh-extend-ui .comment .comment-form>.x-form-tools>.x-form-tools-post {
  order:4;
}
/* The unchanged Custom is_mobile() switches to Enter-to-send at 970px. */
@media(min-width:970px) {
  body.mxh-extend-ui .comment .comment-form>.x-form-tools>.x-form-tools-post {display:none;}
}
body.mxh-extend-ui .comment .comment-form>.x-form-tools>.emoji-menu {
  bottom:40px;
  max-width:calc(100vw - 28px);
}
/* The Custom theme has a separate RTL base; keep the same avatar gutter there. */
html[dir="rtl"] body.mxh-extend-ui .comment>.comment-data,
html[dir="rtl"] body.mxh-extend-ui .comment>.comment-edit {
  margin-left:0;
  margin-right:50px;
}
html[dir="rtl"] body.mxh-extend-ui .comment.reply>.comment-data,
html[dir="rtl"] body.mxh-extend-ui .comment.reply>.comment-edit {
  margin-right:42px;
}
