/* Ampliaciones: variables, botones y tarjetas heredados del diseño original. */
.ncp-extra-title { margin: 0 0 .4rem; font-size: 1.25rem; }
.ncp-extra-description { color: var(--muted); margin-bottom: 1rem; line-height: 1.5; }
.ncp-file-picker { display: grid; gap: .5rem; padding: 1rem; border: 2px dashed var(--border); border-radius: var(--radius); cursor: pointer; }
.ncp-file-picker:focus-within, .ncp-file-picker:hover { border-color: var(--primary); background: #f3f4ff; }
.ncp-file-picker input { max-width: 100%; font: inherit; }
.ncp-extra-card:focus-visible, .ncp-small-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ncp-form-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); gap: 1rem; margin-top: 1rem; }
.ncp-form-grid label { display: grid; gap: .4rem; font-size: .9rem; font-weight: 600; }
.ncp-form-grid input, .ncp-form-grid select, .ncp-text { border: 1px solid var(--border); border-radius: 6px; padding: .6rem; font: inherit; width: 100%; }
.ncp-text { min-height: 12rem; margin-top: 1rem; resize: vertical; direction: auto; }
.ncp-preview-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(145px,1fr)); gap: .8rem; padding: 0; margin: 1rem 0; list-style: none; }
.ncp-page { min-width: 0; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: .6rem; display: grid; gap: .45rem; }
.ncp-page[draggable=true] { cursor: grab; }
.ncp-page.ncp-dragging { opacity: .4; }
.ncp-page.ncp-drop { outline: 2px solid var(--primary); }
.ncp-thumb { width: 100%; min-height: 150px; background: #f3f4f6; display: grid; place-items: center; overflow: hidden; }
.ncp-thumb img { width: 100%; height: auto; display: block; }
.ncp-page label { display: flex; align-items: center; gap: .4rem; font-size: .85rem; }
.ncp-page-actions { display: flex; gap: .35rem; }
.ncp-small-btn { flex: 1; border: 1px solid var(--border); border-radius: 5px; background: white; padding: .35rem; font: inherit; cursor: pointer; }
.ncp-small-btn:hover { background: #eef2ff; }
.ncp-image-preview { max-width: min(100%,450px); max-height: 300px; display: block; object-fit: contain; margin: 1rem auto; }
.ncp-size-comparison { display: flex; justify-content: space-between; gap: .8rem; flex-wrap: wrap; font-size: .9rem; }
#ncp-extra-status { min-height: 1.4em; margin-top: .8rem; color: var(--muted); font-size: .9rem; }
#ncp-extra-status[data-error=true] { color: #b91c1c; }
.ncp-ad { display: flex; justify-content: center; max-width: 100%; overflow: hidden; margin: 0 auto; }
/* El propio anuncio inserta el iframe. No se le añade otro marco con barras. */
.ncp-ad-banner > :not(script), .ncp-ad-square > :not(script) { margin: 1.25rem auto; max-width: 100%; }
.ncp-ad-banner > iframe, .ncp-ad-square > iframe { display: block; border: 0; }
.ncp-ad-native > div { max-width: 100%; overflow: hidden; }
.ncp-ad-native > div:not(:empty) { margin: 1.25rem auto; }
/* Las columnas laterales no invaden el contenido de 1000 px ni crean barras. */
.ncp-ad-sidebar { display: none; }
@media (min-width: 1024px) {
  /* Reserva espacio real para los dos banners también en portátiles de 1024–1399 px. */
  #principal { width: calc(100% - 368px); }
  .ncp-ad-sidebar {
    display: flex;
    position: absolute;
    top: 12rem;
    left: max(8px, calc(50% - 676px));
    width: 160px;
    height: 300px;
    margin: 0;
  }
  .ncp-ad-sidebar > iframe { display: block; width: 160px; height: 300px; border: 0; }
  .ncp-ad-sidebar-right { left: auto; right: max(8px, calc(50% - 676px)); }
}
@media (min-width: 320px) and (max-width: 351px) {
  /* Centra los formatos fijos sin recortarlos en móviles de 320 px. */
  #principal .ncp-ad-banner { width: 320px; max-width: none; margin-left: calc(50% - 160px); }
  #principal .ncp-ad-square { width: 300px; max-width: none; margin-left: calc(50% - 150px); }
}
@media (max-width: 640px) {
  #ncp-extra-workspace { padding: 1.2rem; }
  .ncp-preview-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
