/* AvaClik Editor v0.5.72 — mobile-only contrast and component finishing.
 * The existing monochrome palette lives in v0.5.71. These selectors are
 * intentionally limited to UI, not to user photos, thumbnails or prompts.
 */
@media (max-width:768px) {
  /* 1. The header has nested legacy pink controls and some inline icons. */
  html[data-ava-editor-theme] #fotor-root .esg-topbar,
  html[data-ava-editor-theme] .esg-topbar {
    background:var(--ava-m-panel)!important;
    background-image:none!important;
    color:var(--ava-m-text)!important;
    border-color:var(--ava-m-stroke)!important;
    box-shadow:none!important;
  }
  /* The React header has a separate opaque inner background; changing only
     .esg-topbar left the top strip dark even when the light theme was active. */
  html[data-ava-editor-theme] #fotor-root .esg-topbar__inner {
    background:var(--ava-m-panel)!important;
    background-image:none!important;
    border-color:var(--ava-m-stroke)!important;
    color:var(--ava-m-text)!important;
    box-shadow:none!important;
  }
  html[data-ava-editor-theme] #fotor-root .esg-topbar__brand {
    background:var(--ava-m-panel)!important;
    color:var(--ava-m-text)!important;
    box-shadow:none!important;
  }
  html[data-ava-editor-theme] #fotor-root .esg-topbar :is(
    .esg-balance,.esg-auth--account,.esg-burger,.esg-lang__toggle,
    .esg-nav__link,.esg-topbar__right,.esg-topbar__left
  ) { color:var(--ava-m-text)!important; }
  html[data-ava-editor-theme] #fotor-root .esg-topbar :is(
    .esg-balance,.esg-auth--account,.esg-burger,.esg-lang__toggle,
    .ava-theme-switch,.avaclik-language-trigger
  ) {
    background:var(--ava-m-surface)!important;
    background-image:none!important;
    color:var(--ava-m-text)!important;
    -webkit-text-fill-color:var(--ava-m-text)!important;
    border-color:var(--ava-m-stroke)!important;
    box-shadow:none!important;
  }
  html[data-ava-editor-theme] #fotor-root .esg-topbar :is(
    .esg-balance__icon,.esg-balance__value,.esg-balance__count,
    .esg-auth--account svg,.esg-burger svg,.esg-auth--account span,
    .avaclik-language-trigger svg,.avaclik-language-trigger__label,
    .ava-theme-switch svg
  ) {
    color:var(--ava-m-text)!important;
    -webkit-text-fill-color:var(--ava-m-text)!important;
    stroke:currentColor;
  }
  html[data-ava-editor-theme] #fotor-root .esg-topbar :is(
    .esg-auth--primary,.esg-auth--button.esg-auth--primary
  ) {
    background:var(--ava-m-primary)!important;
    background-image:none!important;
    color:var(--ava-m-on-primary)!important;
    -webkit-text-fill-color:var(--ava-m-on-primary)!important;
    border-color:var(--ava-m-primary)!important;
    box-shadow:none!important;
  }
  html[data-ava-editor-theme] #fotor-root .esg-topbar .ava-daily-free-badge,
  html[data-ava-editor-theme] #fotor-root .esg-topbar .sg-free-badge,
  html[data-ava-editor-theme] body .ava-daily-free-badge {
    background:var(--ava-m-raised)!important;
    color:var(--ava-m-text)!important;
    border-color:var(--ava-m-stroke)!important;
    box-shadow:none!important;
  }
  html[data-ava-editor-theme] .avaclik-language-picker,
  html[data-ava-editor-theme] .avaclik-language-menu {
    --ava-hc-panel:var(--ava-m-panel);
    --ava-hc-surface:var(--ava-m-surface);
    --ava-hc-stroke:var(--ava-m-stroke);
    --ava-hc-text:var(--ava-m-text);
    --ava-hc-accent:var(--ava-m-text);
    --ava-hc-active:var(--ava-m-selected);
  }
  html[data-ava-editor-theme] .avaclik-language-menu .avaclik-language-option[aria-selected="true"] {
    background:var(--ava-m-selected)!important;
    color:var(--ava-m-text)!important;
    border-color:var(--ava-m-stroke)!important;
  }

  /* 2. The hamburger menu is portaled to <body>, not inside the editor.
     Its older CSS was still forcing white text and a blue selected tab. */
  html[data-ava-editor-theme] body .sg-mobile-menu__panel,
  html[data-ava-editor-theme] body .sg-mobile-menu__body {
    background:var(--ava-m-panel)!important;
    background-image:none!important;
    color:var(--ava-m-text)!important;
    border-color:var(--ava-m-stroke)!important;
  }
  html[data-ava-editor-theme] body .sg-mobile-menu__panel :is(
    .sg-mobile-menu__lang-item,.sg-mobile-menu__toggle,.sg-mobile-menu__link,
    .sg-mobile-menu__action,.sg-mobile-menu__close
  ) {
    background:var(--ava-m-surface)!important;
    background-image:none!important;
    border-color:var(--ava-m-stroke)!important;
    color:var(--ava-m-text)!important;
    -webkit-text-fill-color:var(--ava-m-text)!important;
    box-shadow:none!important;
  }
  html[data-ava-editor-theme] body .sg-mobile-menu__panel :is(
    .sg-mobile-menu__lang-item.is-current,
    .sg-mobile-menu__lang-item[aria-selected="true"],
    .sg-mobile-menu__toggle[aria-expanded="true"],
    .sg-mobile-menu__link.active
  ) {
    background:var(--ava-m-selected)!important;
    border-color:var(--ava-m-accent)!important;
    color:var(--ava-m-text)!important;
  }
  html[data-ava-editor-theme] body .sg-mobile-menu__panel :is(
    .sg-mobile-menu__group-title,.sg-mobile-menu__sublink,
    .sg-mobile-menu__toggle-label,.sg-mobile-menu__language-title
  ) {
    color:var(--ava-m-muted)!important;
    -webkit-text-fill-color:var(--ava-m-muted)!important;
  }
  html[data-ava-editor-theme] body .sg-mobile-menu__panel :is(
    .sg-mobile-menu__group,.sg-mobile-menu__submenu,
    .sg-mobile-menu__group-title,.sg-mobile-menu__sublink
  ) { border-color:var(--ava-m-stroke)!important; }
  html[data-ava-editor-theme] body .sg-mobile-menu__panel .sg-mobile-menu__sublink {
    background:transparent!important;
  }
  html[data-ava-editor-theme] body .sg-mobile-menu__panel .sg-mobile-menu__action:last-child {
    background:var(--ava-m-primary)!important;
    color:var(--ava-m-on-primary)!important;
    -webkit-text-fill-color:var(--ava-m-on-primary)!important;
    border-color:var(--ava-m-primary)!important;
  }
  /* Explicit descendant text: in the old menu, nested span/strong carried
     hardcoded #ddd/#fff !important, unreadable on the light surface. */
  html[data-ava-editor-theme] body .sg-mobile-menu__panel :is(
    .sg-mobile-menu__lang-item,.sg-mobile-menu__toggle,.sg-mobile-menu__link,
    .sg-mobile-menu__close
  ) :is(span,strong,small,i,svg) {
    color:var(--ava-m-text)!important;
    -webkit-text-fill-color:var(--ava-m-text)!important;
  }
  html[data-ava-editor-theme] body .sg-mobile-menu__panel .sg-mobile-menu__action:last-child :is(span,strong,small,svg) {
    color:var(--ava-m-on-primary)!important;
    -webkit-text-fill-color:var(--ava-m-on-primary)!important;
  }
  html[data-ava-editor-theme] body .sg-mobile-menu__panel .sg-mobile-menu__group-title :is(span,strong,small),
  html[data-ava-editor-theme] body .sg-mobile-menu__panel .sg-mobile-menu__sublink :is(span,strong,small) {
    color:var(--ava-m-muted)!important;
    -webkit-text-fill-color:var(--ava-m-muted)!important;
  }
  html[data-ava-editor-theme] body .sg-mobile-menu__panel :is(button,a):focus-visible {
    outline:2px solid var(--ava-m-accent)!important;
    outline-offset:2px!important;
  }

  /* The editor's actual mobile Info/language accordion is `.esg-mobile-menu`
     (the older `sg-mobile-menu` above belongs to a separate menu layer). */
  html[data-ava-editor-theme] #fotor-root .esg-mobile-menu,
  html[data-ava-editor-theme] #fotor-root .esg-mobile-menu__section,
  html[data-ava-editor-theme] #fotor-root .esg-mobile-menu__section--lang {
    background:var(--ava-m-panel)!important;
    background-image:none!important;
    color:var(--ava-m-text)!important;
    border-color:var(--ava-m-stroke)!important;
  }
  html[data-ava-editor-theme] #fotor-root .esg-mobile-menu :is(
    .esg-mobile-menu__accordion,.esg-mobile-menu__link,
    .esg-mobile-menu__lang,.esg-mobile-menu__auths button,
    .esg-mobile-menu__auths a
  ) {
    background:var(--ava-m-surface)!important;
    background-image:none!important;
    color:var(--ava-m-text)!important;
    -webkit-text-fill-color:var(--ava-m-text)!important;
    border-color:var(--ava-m-stroke)!important;
    box-shadow:none!important;
  }
  html[data-ava-editor-theme] #fotor-root .esg-mobile-menu :is(
    .esg-mobile-menu__accordion[aria-expanded="true"],
    .esg-mobile-menu__lang.is-current
  ) {
    background:var(--ava-m-selected)!important;
    border-color:var(--ava-m-accent)!important;
    color:var(--ava-m-text)!important;
  }
  html[data-ava-editor-theme] #fotor-root .esg-mobile-menu :is(
    .esg-mobile-menu__accordion span,.esg-mobile-menu__accordion svg,
    .esg-mobile-menu__lang span,.esg-mobile-menu__lang-code,
    .esg-mobile-menu__link span,.esg-mobile-menu__link,
    .esg-mobile-menu__group-title
  ) {
    color:var(--ava-m-text)!important;
    -webkit-text-fill-color:var(--ava-m-text)!important;
  }
  html[data-ava-editor-theme] #fotor-root .esg-mobile-menu :is(
    .esg-mobile-menu__title,.esg-mobile-menu__group-title
  ) {
    color:var(--ava-m-muted)!important;
    -webkit-text-fill-color:var(--ava-m-muted)!important;
  }
  html[data-ava-editor-theme] #fotor-root .esg-mobile-menu__auths .esg-auth--primary {
    background:var(--ava-m-primary)!important;
    color:var(--ava-m-on-primary)!important;
    -webkit-text-fill-color:var(--ava-m-on-primary)!important;
    border-color:var(--ava-m-primary)!important;
  }
  html[data-ava-editor-theme] #fotor-root .esg-mobile-menu :is(a,button):focus-visible {
    outline:2px solid var(--ava-m-accent)!important;
    outline-offset:2px!important;
  }

  /* 3. The separate Outfit Try-On modal is portaled outside #fotor-root;
     it previously kept a rose gradient, cards and accent buttons. */
  html[data-ava-editor-theme] body .ava-tryon-modal-card,
  html[data-ava-editor-theme] body .ava-tryon-modal .ava-tryon-panel,
  html[data-ava-editor-theme] body .ava-tryon-modal .ava-tryon-scroll {
    background:var(--ava-m-panel)!important;
    background-image:none!important;
    border-color:var(--ava-m-stroke)!important;
    color:var(--ava-m-text)!important;
  }
  html[data-ava-editor-theme] body .ava-tryon-modal :is(
    .ava-tryon-mobile-header,.ava-tryon-footer,.ava-tryon-group
  ) {
    background:var(--ava-m-panel)!important;
    background-image:none!important;
    border-color:var(--ava-m-stroke)!important;
    color:var(--ava-m-text)!important;
  }
  html[data-ava-editor-theme] body .ava-tryon-modal :is(
    .ava-tryon-mobile-header h2,.ava-tryon-group legend,
    .ava-tryon-target,.ava-tryon-target label
  ) { color:var(--ava-m-text)!important; }
  html[data-ava-editor-theme] body .ava-tryon-modal :is(.ava-tryon-note,.ava-tryon-hint) {
    color:var(--ava-m-muted)!important;
  }
  html[data-ava-editor-theme] body .ava-tryon-modal :is(
    .ava-tryon-tile,.ava-tryon-mobile-header button,.ava-tryon-target select
  ) {
    background:var(--ava-m-surface)!important;
    background-image:none!important;
    color:var(--ava-m-text)!important;
    border-color:var(--ava-m-stroke)!important;
    box-shadow:none!important;
  }
  html[data-ava-editor-theme] body .ava-tryon-modal .ava-tryon-tile:has(:checked) {
    background:var(--ava-m-selected)!important;
    border-color:var(--ava-m-accent)!important;
    color:var(--ava-m-text)!important;
    box-shadow:inset 0 0 0 1px var(--ava-m-stroke)!important;
  }
  html[data-ava-editor-theme] body .ava-tryon-modal :is(.ava-tryon-placeholder) {
    background:var(--ava-m-raised)!important;
    color:var(--ava-m-text)!important;
  }
  html[data-ava-editor-theme] body .ava-tryon-modal .ava-tryon-apply {
    background:var(--ava-m-primary)!important;
    background-image:none!important;
    color:var(--ava-m-on-primary)!important;
    border-color:var(--ava-m-primary)!important;
    box-shadow:none!important;
  }
  html[data-ava-editor-theme] body .ava-tryon-modal .ava-tryon-apply:disabled {
    background:var(--ava-m-disabled)!important;
    color:var(--ava-m-on-disabled)!important;
    border-color:var(--ava-m-stroke)!important;
    opacity:1!important;
  }
  html[data-ava-editor-theme] body .ava-tryon-modal :is(button,select,input):focus-visible,
  html[data-ava-editor-theme] body .ava-tryon-modal .ava-tryon-tile:has(:focus-visible) {
    outline:2px solid var(--ava-m-accent)!important;
    outline-offset:2px!important;
  }

  /* 4. On Looks collapse, hide the entire sheet including its tabs. The
     arrow+apply toolbar remains reachable immediately above bottom nav. */
  body.sg-looks-active .sg-looks-mobile-pane.is-collapsed,
  body.sg-looks-active .sg-looks-mobile-pane.is-collapsed:not(.is-custom) {
    display:none!important;
    visibility:hidden!important;
    pointer-events:none!important;
  }
  body.sg-looks-active .sg-looks-mobile-controls.is-collapsed {
    background:transparent!important;
  }

  /* 5. The floating back/forward/fit capsule had a square group outline.
     Round the group and keep each native control clickable and independent. */
  html[data-ava-editor-theme] #fotor-root .editor-shell.is-mobile .ws-float-controls.is-mobile-floating {
    border-radius:12px!important;
    padding:2px!important;
    overflow:hidden!important;
    background:var(--ava-m-panel)!important;
    border:1px solid var(--ava-m-stroke)!important;
    box-shadow:0 4px 14px rgba(0,0,0,.14)!important;
  }
  html[data-ava-editor-theme] #fotor-root .editor-shell.is-mobile .ws-float-controls.is-mobile-floating :is(
    .fc-btn[data-role="undo"],.fc-btn[data-role="redo"],.fc-btn--fit.sg-mobile-fit-view
  ) {
    border-radius:9px!important;
    color:var(--ava-m-text)!important;
    border-color:var(--ava-m-stroke)!important;
    background:var(--ava-m-surface)!important;
    box-shadow:none!important;
  }
  html[data-ava-editor-theme] #fotor-root .editor-shell.is-mobile .ws-float-controls.is-mobile-floating :is(
    .fc-btn[data-role="undo"],.fc-btn[data-role="redo"],.fc-btn--fit.sg-mobile-fit-view
  ):disabled {
    color:var(--ava-m-on-disabled)!important;
    background:var(--ava-m-disabled)!important;
  }
}
