/* Shared by lean and legacy pages. Never style the contents of Google frames. */
.mley-ad-shell {
  margin: 1rem 0 1.25rem;
}

.mley-ad-shell__label {
  margin-bottom: 0.4rem;
  font-size: var(--text-caption);
  font-weight: var(--weight-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-color);
}

.mley-ad-shell__frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: visible;
  background: var(--bg-surface);
}

.mley-ad-shell__frame::before {
  content: none;
  display: block;
  padding: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.mley-ad-shell__frame[data-ad-slot-state="requested"]::before,
.mley-ad-shell__frame[data-ad-slot-state="rendered"]::before,
.mley-ad-shell__frame[data-ad-slot-state="filled"]::before,
.mley-ad-shell__frame[data-ad-slot-state="unfilled"]::before {
  display: none;
}

.mley-ad-shell--unfilled .mley-ad-shell__label {
  display: none;
}

.mley-ad-shell--unfilled .mley-ad-shell__frame {
  border: none;
  background: transparent;
  box-shadow: none;
}

.mley-ad-shell--unfilled .mley-ad-shell__frame::before {
  display: none;
}

/* Runtime diagnostics distinguish a network failure from Google's no-fill.
   Retain the reserved space so a delayed response does not shift reading. */
.mley-ad-shell__frame[data-ad-slot-state="loading"]::before,
.mley-ad-shell__frame[data-ad-slot-state="timeout"]::before,
.mley-ad-shell__frame[data-ad-slot-state="sdk-timeout"]::before,
.mley-ad-shell__frame[data-ad-slot-state="sdk-error"]::before,
.mley-ad-shell__frame[data-ad-slot-state="error"]::before,
.mley-ad-shell__frame[data-ad-slot-state="hidden"]::before,
.mley-ad-shell__frame[data-ad-slot-state="disabled"]::before,
.mley-ad-shell__frame[data-ad-slot-state="unfill-optimized"]::before {
  display: none;
}

.mley-ad-shell:is([data-ad-state="sdk-error"], [data-ad-state="sdk-timeout"],
  [data-ad-state="error"], [data-ad-state="timeout"], [data-ad-state="hidden"],
  [data-ad-state="disabled"]) .mley-ad-shell__label {
  visibility: hidden;
}

.mley-ad-shell:is([data-ad-state="sdk-error"], [data-ad-state="sdk-timeout"],
  [data-ad-state="error"], [data-ad-state="timeout"], [data-ad-state="hidden"],
  [data-ad-state="disabled"]) .mley-ad-shell__frame {
  background: transparent;
  border-color: transparent;
}

.mley-ad-shell--banner .mley-ad-shell__frame {
  min-height: 124px;
}

.mley-ad-shell--rectangle .mley-ad-shell__frame {
  min-height: 304px;
}

.mley-ad-slot {
  display: block;
  width: 100%;
  min-width: 100%;
}

/* Preview is local-only; visitors never see technical placeholders. */
.mley-ad-shell[data-ad-preview="1"] .mley-ad-shell__frame::before {
  content: "Vista previa de publicidad";
}

/* Reserve a common responsive mobile height before requesting the slot. */
@media (max-width: 600px) {
  .mley-ad-shell--banner .mley-ad-shell__frame { min-height: 250px; }
}

@media (min-width: 992px) {
  .mley-ad-shell--banner .mley-ad-shell__frame {
    min-height: 138px;
  }

  .mley-ad-shell--rectangle .mley-ad-shell__frame {
    min-height: 328px;
  }
}

/* Only definitive no-fill/failure collapses. A pending timeout may still fill. */
.mley-ad-shell:is([data-ad-state="unfilled"], [data-ad-state="unfill-optimized"],
  [data-ad-state="sdk-error"], [data-ad-state="sdk-timeout"],
  [data-ad-state="error"], [data-ad-state="disabled"]) {
  display: none;
  margin-block: 0;
}
.mley-ad-shell:is([data-ad-state="unfilled"], [data-ad-state="unfill-optimized"],
  [data-ad-state="sdk-error"], [data-ad-state="sdk-timeout"],
  [data-ad-state="error"], [data-ad-state="disabled"]) .mley-ad-shell__label {
  display: none;
}
.mley-ad-shell:is([data-ad-state="unfilled"], [data-ad-state="unfill-optimized"],
  [data-ad-state="sdk-error"], [data-ad-state="sdk-timeout"],
  [data-ad-state="error"], [data-ad-state="disabled"]) .mley-ad-shell__frame {
  min-height: 0;
  border: 0;
  background: transparent;
}
/* Support is one dialog: shared header, two options and quiet secondary actions. */
.modal.mley-support-modal .modal-dialog { max-width: 740px; }
.mley-support-modal .modal-content { background: var(--bg-surface); color: var(--text-color); border: 1px solid var(--border-color); border-radius: 22px; font-family: var(--font-ui); }
.mley-support-modal .modal-header { align-items: center; flex-wrap: nowrap; gap: .75rem; padding: 1rem 1.25rem; border-color: var(--border-color); }
.mley-support-modal .modal-title { display: flex; flex: 1; min-width: 0; overflow: visible; margin: 0; }
.mley-support-modal .modal-header .close { display: grid; place-items: center; width: 44px; height: 44px; min-width: 44px; margin: 0; padding: 0; border-radius: 10px; color: var(--text-muted); }
.mley-support-modal .modal-header .close:hover { background: var(--bg-surface-2); color: var(--text-color); }
.mley-support-identity { display: flex; flex: 1; min-width: 0; flex-wrap: nowrap; align-items: center; gap: 1rem; font-family: var(--font-ui); color: var(--text-color); }
.mley-support-heading { flex: 1; min-width: 0; font-size: clamp(1rem, 2.4vw, 1.25rem); font-weight: var(--weight-semibold); line-height: 1.25; white-space: nowrap; }
.mley-support-logo { display: inline-block; flex: none; }
.mley-support-logo img { display: block; width: 96px; height: auto; max-width: none; }
.mley-support-logo .mley-support-logo--dark { display: none; }
:root[data-theme="dark"] .mley-support-logo--light { display: none; }
:root[data-theme="dark"] .mley-support-logo .mley-support-logo--dark { display: block; }
.mley-support-modal .modal-body { padding: 1.5rem; background: var(--bg-surface-2); }
.mley-support-intro { margin: 0 0 .45rem; font-size: 1.0625rem; font-weight: var(--weight-semibold); line-height: 1.45; }
.mley-support-description { margin: 0 0 1.4rem; color: var(--text-muted); font-size: .9375rem; line-height: 1.6; }
.mley-support-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 1rem; }
.mley-support-options--single { grid-template-columns: minmax(0, 1fr); }
.mley-support-option { display: flex; flex-direction: column; min-width: 0; padding: 1.25rem; border: 1px solid var(--border-color); border-radius: 16px; background: var(--bg-surface); box-shadow: 0 3px 14px rgb(0 0 0 / .025); }
.mley-support-option__label { display: flex; align-items: center; gap: .5rem; color: var(--text-muted); font-size: .8125rem; font-weight: var(--weight-semibold); line-height: 1.25; }
.mley-support-option__icon { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 10px; background: var(--surface-accent); color: var(--accent-color); }
.mley-support-option__icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.85; stroke-linecap: round; stroke-linejoin: round; }
.mley-support-option h3 { margin: 1rem 0 .6rem; color: var(--text-color); font: var(--weight-semibold) clamp(1rem, 2vw, 1.1875rem)/1.35 var(--font-ui); overflow-wrap: anywhere; }
.mley-support-option p { margin: 0 0 1.25rem; color: var(--text-muted); font-size: .875rem; line-height: 1.55; }
.mley-support-option__action { margin-top: auto; padding-top: .25rem; }
.mley-support-modal .mley-support-option__action .btn { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 46px; margin: 0; padding: .65rem .7rem; border: 1px solid var(--accent-color); border-radius: 10px; background: var(--bg-surface); color: var(--accent-color); font: var(--weight-semibold) .9375rem/1.25 var(--font-ui); white-space: normal; box-shadow: none; }
.mley-support-modal .mley-support-option__action [data-overlay-button="login"],
.mley-support-modal .mley-support-options--single .mley-support-option__action [data-overlay-button="donate"] { background: var(--accent-color); color: var(--bg-surface); }
.mley-support-modal .mley-support-option__action .btn:hover { filter: brightness(.95); }
.mley-support-hint { margin: 1rem 0 0; color: var(--text-muted); font-size: .8125rem; line-height: 1.5; }
.mley-support-modal .modal-footer { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; padding: .9rem 1.25rem; border-color: var(--border-color); }
.mley-support-modal .modal-footer .btn { min-width: 0; min-height: 44px; margin: 0; padding: .5rem .7rem; border: 1px solid var(--border-color); border-radius: 10px; background: var(--bg-surface); color: var(--text-muted); font: var(--weight-semibold) .875rem/1.3 var(--font-ui); white-space: normal; }
.mley-support-modal .modal-footer .btn:hover { background: var(--bg-surface-2); color: var(--text-color); }
.mley-support-modal :is(button, a):focus-visible { outline: 2px solid var(--accent-color); outline-offset: 3px; }
@media (max-width: 480px) {
  .mley-support-modal .modal-header { gap: .5rem; padding: .75rem; }
  .mley-support-identity { gap: .5rem; }
  .mley-support-logo img { width: 72px; }
  .mley-support-modal .modal-body { padding: 1rem; }
  .mley-support-options { gap: .6rem; }
  .mley-support-option { padding: .8rem; border-radius: 13px; }
  .mley-support-option__label { flex-direction: column; align-items: flex-start; gap: .4rem; }
  .mley-support-option h3 { margin-top: .75rem; }
  .mley-support-option p { font-size: .8125rem; }
  .mley-support-modal .mley-support-option__action .btn { font-size: .8125rem; }
  .mley-support-modal .modal-footer { gap: .5rem; padding: .75rem; }
}
