/* ESFX V77 — mobile chat composer + responsive dark UI hardening.
   Loaded after v72/v75/v76. New paint rules are dark-only; desktop logo sizing is
   independent of theme. No JS, layout routing, or user data changes. */

/* The V33/V42 mobile conversation rules use a fixed #fff !important on a deeply
   nested selector; a generic .chat-compose dark rule cannot override that. */
html[data-esfx-theme="dark"] body.esfx-chat-conversation .messenger-shell:has(.chat-head) form.chat-compose,
html[data-esfx-theme="dark"] body.esfx-native-app.esfx-chat-conversation .messenger-shell:has(.chat-head) form.chat-compose {
  background:#26343d!important;
  background-color:#26343d!important;
  background-image:none!important;
  color:#e8eff0!important;
  border-top:1px solid #44535e!important;
  box-shadow:none!important;
}
html[data-esfx-theme="dark"] body.esfx-chat-conversation .messenger-shell:has(.chat-head) .chat-compose-row,
html[data-esfx-theme="dark"] body.esfx-native-app.esfx-chat-conversation .messenger-shell:has(.chat-head) .chat-compose-row{
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
}
html[data-esfx-theme="dark"] body.esfx-chat-conversation .messenger-shell:has(.chat-head) .chat-compose-row textarea,
html[data-esfx-theme="dark"] body.esfx-native-app.esfx-chat-conversation .messenger-shell:has(.chat-head) .chat-compose-row textarea {
  background:#2f404a!important;
  color:#e9f0f2!important;
  border:1px solid #4a5b65!important;
  border-radius:12px!important;
  box-shadow:none!important;
}
html[data-esfx-theme="dark"] body.esfx-chat-conversation .messenger-shell:has(.chat-head) .chat-compose-row textarea:focus{
  border-color:#55bd93!important;
  outline:0!important;
  box-shadow:0 0 0 2px rgba(46,191,137,.16)!important;
}
/* Guard against bright seams around the composer in native WebView, including
   iPhone bottom safe area. Keep existing keyboard/viewport sizing untouched. */
html[data-esfx-theme="dark"] body.esfx-chat-conversation .messenger-main,
html[data-esfx-theme="dark"] body.esfx-chat-conversation .messenger-main .chat-thread,
html[data-esfx-theme="dark"] body.esfx-native-app.esfx-chat-conversation .messenger-main{
  background-color:#1c2831!important;
  background-image:none!important;
}
html[data-esfx-theme="dark"] body.esfx-chat-conversation .messenger-main .chat-compose{
  -webkit-tap-highlight-color:transparent;
}

/* The user-approved light and dark desktop logos were 118x42 (V70). Make both
   a little less dominant without touching the 860px mobile breakpoint. */
@media(min-width:861px){
  .site-header .brand.brand-logo-only img.esfx-brand-light,
  .site-header .brand.brand-logo-only img.esfx-brand-dark{
    width:105px!important;
    max-width:105px!important;
    height:38px!important;
    max-height:38px!important;
    object-fit:contain!important;
  }
  .site-header .brand.brand-logo-only{flex-shrink:0}
}

/* Isolated small-screen polish: avoid one light native action background from
   leaking into dark mode; preserve hit-target sizing introduced in V76. */
@media(max-width:860px){
  html[data-esfx-theme="dark"] body.esfx-native-app .esfx-native-header .esfx-theme-toggle-native,
  html[data-esfx-theme="dark"] body.esfx-native-app .esfx-native-header .esfx-native-icon-link,
  html[data-esfx-theme="dark"] body.esfx-native-app .esfx-native-header .esfx-native-menu-toggle{
    background:#22313a!important;
    border-color:#344752!important;
    color:#d9e4e8!important;
  }
  html[data-esfx-theme="dark"] body.esfx-native-app .esfx-native-header .esfx-native-icon-link.active{
    background:#205a46!important;
    border-color:#316d57!important;
    color:#d9fbe7!important;
  }
}

/* Final cross-page audit: both surfaces used --ink for a light-mode dark hero.
   V72 changes --ink to near-white, unintentionally turning these two large
   sections white in Dark Mode while their text remains white. */
html[data-esfx-theme="dark"] .auth-visual{
  background:linear-gradient(140deg,#223943 0%,#1a2a34 100%)!important;
  color:#f0f6f5!important;
}
html[data-esfx-theme="dark"] .auth-visual :is(h1,h2,strong){color:#f0f6f5!important}
html[data-esfx-theme="dark"] .auth-visual p{color:#c4d5da!important}
html[data-esfx-theme="dark"] .policy-hero{
  background:linear-gradient(132deg,#243b43,#1d2f38)!important;
  border:1px solid #38505a!important;
  color:#f0f6f5!important;
}
html[data-esfx-theme="dark"] .policy-hero :is(h1,h2,strong){color:#f0f6f5!important}
html[data-esfx-theme="dark"] .policy-hero p{color:#c6d5d9!important}
