/* AvaClik 0.5.73 — mobile readability fixes.
 * Scope: AI by prompt reference picker and Face Swap native mobile sheet.
 * Theme tokens are defined in avaclik-mobile-monochrome-0571.css.
 * No changes to image assets, image previews or processing logic.
 */
@media (max-width: 768px) {
  /* AI by prompt: the reference picker has legacy #f0f4ff / #f4d6e1 text,
     which became invisible when the enclosing modal turned white. */
  html[data-ava-editor-theme] #fotor-root .agent-popup .ai-agent .av-description-refs {
    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;
  }
  html[data-ava-editor-theme] #fotor-root .agent-popup .ai-agent .av-description-refs :is(
    .av-description-refs__base,.av-description-refs__heading,
    .av-description-refs__heading > span,.av-description-refs__item > span
  ) {
    color:var(--ava-m-text)!important;
    -webkit-text-fill-color:var(--ava-m-text)!important;
    opacity:1!important;
  }
  html[data-ava-editor-theme] #fotor-root .agent-popup .ai-agent .av-description-refs :is(
    .av-description-refs__help,.av-description-refs__heading small
  ) {
    color:var(--ava-m-muted)!important;
    -webkit-text-fill-color:var(--ava-m-muted)!important;
    opacity:1!important;
  }
  html[data-ava-editor-theme] #fotor-root .agent-popup .ai-agent .av-description-refs__add,
  html[data-ava-editor-theme] #fotor-root .agent-popup .ai-agent .av-description-refs__item {
    background:var(--ava-m-panel)!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] #fotor-root .agent-popup .ai-agent .av-description-refs__add:focus-within {
    outline:2px solid var(--ava-m-accent)!important;
    outline-offset:2px!important;
  }
  /* Other reference/consent text in the same mobile AI form. */
  html[data-ava-editor-theme] #fotor-root .agent-popup:not(.text-image-popup) .ai-agent :is(
    .sg-agent-adult-consent,.sg-agent-adult-consent__text,.sg-agent-adult-consent__label,
    .ai-agent__label,.ai-agent__block-title
  ) {
    color:var(--ava-m-text)!important;
    -webkit-text-fill-color:var(--ava-m-text)!important;
  }
  html[data-ava-editor-theme] #fotor-root .agent-popup:not(.text-image-popup) .ai-agent :is(
    .ai-agent__hint,.ai-agent__help,.ai-agent__demo-note,.ai-agent__help-text,
    .sg-agent-adult-consent__error
  ) {
    color:var(--ava-m-muted)!important;
    -webkit-text-fill-color:var(--ava-m-muted)!important;
  }
  html[data-ava-editor-theme] #fotor-root .agent-popup:not(.text-image-popup) .ai-agent .sg-agent-adult-consent {
    background:var(--ava-m-surface)!important;
    border-color:var(--ava-m-stroke)!important;
  }

  /* Face Swap is its own bottom sheet, not the AI-agent modal. Old rules in
     mobile-swap-popup.css forced a charcoal header even in light mode. */
  html[data-ava-editor-theme] #fotor-root .editor-shell.is-mobile .left-panel.left-panel--tool-ai-face-swap {
    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] #fotor-root .editor-shell.is-mobile .left-panel.left-panel--tool-ai-face-swap :is(
    .left-panel-header,.left-panel-title,.left-panel-body,.mobile-tool-page--swap,
    .mobile-tool-content--swap,.ai-hair-page,.ai-hair-top,.ai-hair-footer
  ) {
    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] #fotor-root .editor-shell.is-mobile .left-panel.left-panel--tool-ai-face-swap .left-panel-header :is(
    .lp-title,.lp-title-row,.left-panel-title
  ) {
    color:var(--ava-m-text)!important;
    -webkit-text-fill-color:var(--ava-m-text)!important;
    opacity:1!important;
  }
  html[data-ava-editor-theme] #fotor-root .editor-shell.is-mobile .left-panel.left-panel--tool-ai-face-swap .left-panel-header .lp-subtitle {
    color:var(--ava-m-muted)!important;
    -webkit-text-fill-color:var(--ava-m-muted)!important;
    opacity:1!important;
  }
  html[data-ava-editor-theme] #fotor-root .editor-shell.is-mobile .left-panel.left-panel--tool-ai-face-swap :is(
    .lp-back,.lp-close,.ai-refs-btn
  ) {
    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;
    opacity:1!important;
  }
  html[data-ava-editor-theme] #fotor-root .editor-shell.is-mobile .left-panel.left-panel--tool-ai-face-swap :is(.lp-back,.lp-close) svg {
    color:var(--ava-m-text)!important;
    stroke:currentColor!important;
  }
  html[data-ava-editor-theme] #fotor-root .editor-shell.is-mobile .left-panel.left-panel--tool-ai-face-swap .ai-hair-top > div[style*="border"],
  html[data-ava-editor-theme] #fotor-root .editor-shell.is-mobile .left-panel.left-panel--tool-ai-face-swap :is(
    .sg-face-swap-upload-card,.sg-face-swap-quality,.sg-face-swap-consent,.ai-refs
  ) {
    background:var(--ava-m-surface)!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 .editor-shell.is-mobile .left-panel.left-panel--tool-ai-face-swap :is(
    .sg-face-swap-upload-card,.sg-face-swap-quality,.sg-face-swap-consent,.ai-hair-top
  ) :is(span,small,strong,p,label) {
    color:var(--ava-m-text)!important;
    -webkit-text-fill-color:var(--ava-m-text)!important;
  }
  html[data-ava-editor-theme] #fotor-root .editor-shell.is-mobile .left-panel.left-panel--tool-ai-face-swap .ai-hair-top button[aria-pressed] {
    background:var(--ava-m-panel)!important;
    background-image:none!important;
    border:1px solid 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] #fotor-root .editor-shell.is-mobile .left-panel.left-panel--tool-ai-face-swap .ai-hair-top button[aria-pressed="true"] {
    background:var(--ava-m-selected)!important;
    border-color:var(--ava-m-accent)!important;
    font-weight:700!important;
  }
  html[data-ava-editor-theme] #fotor-root .editor-shell.is-mobile .left-panel.left-panel--tool-ai-face-swap .ai-hair-top input[type="checkbox"] {
    accent-color:var(--ava-m-accent)!important;
  }
  html[data-ava-editor-theme] #fotor-root .editor-shell.is-mobile .left-panel.left-panel--tool-ai-face-swap .ai-hair-run {
    background:var(--ava-m-primary)!important;
    background-image:none!important;
    border-color:var(--ava-m-primary)!important;
    color:var(--ava-m-on-primary)!important;
    -webkit-text-fill-color:var(--ava-m-on-primary)!important;
  }
  html[data-ava-editor-theme] #fotor-root .editor-shell.is-mobile .left-panel.left-panel--tool-ai-face-swap .ai-hair-run:disabled {
    background:var(--ava-m-disabled)!important;
    border-color:var(--ava-m-stroke)!important;
    color:var(--ava-m-on-disabled)!important;
    -webkit-text-fill-color:var(--ava-m-on-disabled)!important;
    opacity:1!important;
  }
}
