.imageee-ad-choice-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  gap: 8px;
  direction: ltr;
}
body[data-page] .frame-head .imageee-ad-choice-controls > .lang-control {
  flex: 0 1 auto;
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  margin: 0;
}
body[data-page] .frame-head .imageee-ad-choice-controls > .lang-control select {
  min-width: 0;
  max-width: 100%;
}
html[dir="rtl"] .imageee-ad-choice-controls > * { direction: rtl; }
.imageee-ad-choice-trigger {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border, #d4ddd7);
  border-radius: 10px;
  background: var(--surface, #fff);
  color: var(--text, #19251f);
  font: inherit;
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
}
.imageee-ad-choice-label { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.imageee-ad-choice-track {
  display: flex;
  align-items: center;
  flex: 0 0 30px;
  box-sizing: border-box;
  width: 30px;
  height: 18px;
  padding: 2px;
  border: 1px solid #66756e;
  border-radius: 999px;
  background: #66756e;
  direction: ltr;
}
.imageee-ad-choice-knob {
  display: block;
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
}
.imageee-ad-choice-trigger[aria-checked="true"] .imageee-ad-choice-track { border-color: #17663b; background: #17663b; }
.imageee-ad-choice-trigger[aria-checked="true"] .imageee-ad-choice-knob { transform: translateX(12px); }
.imageee-ad-choice-trigger:disabled { cursor: progress; }
.imageee-ad-choice-dialog {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  width: min(440px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  height: fit-content;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--border, #d4ddd7);
  border-radius: 20px;
  background: var(--card, #fff);
  color: var(--text, #19251f);
  box-shadow: 0 16px 64px #142a2440;
  text-align: start;
  font: inherit;
  line-height: 1.5;
}
.imageee-ad-choice-dialog::backdrop { background: #13251f80; }
.imageee-ad-choice-dialog h2 { margin: 0 0 8px; font-size: 1.25rem; line-height: 1.3; }
.imageee-ad-choice-dialog p { margin: 0 0 14px; font-size: .9rem; }
.imageee-ad-choice-dialog fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.imageee-ad-choice-eligibility input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: #17663b; }
.imageee-ad-choice-eligibility { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; margin: 4px 0 16px; font-size: .875rem; cursor: pointer; }
.imageee-ad-choice-dialog [hidden] { display: none !important; }
.imageee-ad-choice-dialog .imageee-ad-choice-note { margin: 12px 0 0; color: var(--muted, #53635a); font-size: .8rem; }
.imageee-ad-choice-dialog .imageee-ad-choice-status { min-height: 1.5em; margin: 12px 0; font-size: .875rem; }
.imageee-ad-choice-status[data-error="true"] { color: #a21f2b; }
.imageee-ad-choice-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.imageee-ad-choice-actions button { min-height: 44px; padding: 10px 18px; border: 1px solid #b8c7bf; border-radius: 10px; background: #fff; color: #213c2d; font: inherit; font-weight: 600; line-height: 1.3; cursor: pointer; }
.imageee-ad-choice-actions button[type="submit"] { border-color: #17663b; background: #17663b; color: #fff; }
.imageee-ad-choice-actions button:disabled { opacity: .5; cursor: default; }
.imageee-ad-choice-trigger:focus-visible,
.imageee-ad-choice-dialog :is(button, input):focus-visible { outline: 3px solid #3367e8; outline-offset: 3px; }
@media (max-width: 980px) {
  /* Keep the two controls together. The existing wrapping header puts this
     entire group below the brand when their combined widths cannot fit. */
  body[data-page] .frame-head .head-right:has(> .imageee-ad-choice-controls) {
    flex-basis: 280px;
    max-width: 100%;
    flex-wrap: wrap;
  }
  .imageee-ad-choice-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: stretch;
    width: min(100%, 360px);
  }
  body[data-page] .frame-head .imageee-ad-choice-controls > .lang-control {
    width: 100%;
    justify-content: center;
  }
  body[data-page] .frame-head .imageee-ad-choice-controls > .lang-control select {
    width: 100%;
  }
  .imageee-ad-choice-trigger { gap: 6px; padding: 8px; font-size: .75rem; }
}
@media (forced-colors: active) {
  .imageee-ad-choice-track { border-color: ButtonText; background: Canvas; }
  .imageee-ad-choice-knob { background: ButtonText; }
  .imageee-ad-choice-trigger[aria-checked="true"] .imageee-ad-choice-track { border-color: Highlight; background: Highlight; }
  .imageee-ad-choice-trigger[aria-checked="true"] .imageee-ad-choice-knob { background: HighlightText; }
}
@media (max-width: 420px) { .imageee-ad-choice-dialog { padding: 18px; } .imageee-ad-choice-actions button { flex: 1 1 100px; } }
